VcHostVirtualSwitch 'portgroup' object property returns the array of channels, no objects

Something seems a little wrong here; on a vSphere 5.5 installation, you ask a traditional vSwitch (IE not dvSwitch) for exchanges that I do not receive the table of object of type [VcHostPortGroup], but rather an array of flat strings that cannot be extended.

This seems to break the shares provided for registration of trade as well as my own code, so I suspect that some changes in the API 5.5 can have passed unnoticed since so few people more uses vSwitches.

Could someone check the following code and see what happens:

var hosts=Server.findAllForType("VC:HostSystem");


var host=hosts[0];
var switches=host.configManager.networkSystem.networkInfo.vswitch;

for (var i=0; i<switches.length; i++) {
  vswitch=switches[i];
  System.log(vswitch);
  var pglist=vswitch.portgroup;
  for (var n=0;n<pglist.length;n++) {
  var pg=pglist[n];
  System.log (pg);
System.log("Found portgroup "+ pg.spec.name +" with vlan ID "+pg.spec.vlanId); // This breaks
  }
}

Okay, so I figured this out on my own.

There is a bug in the documentation in the API of vCO HostVirtualSwitch object does not point to a group of ports, but rather returns an array of strings "flattened" with the keys (not unique, useless) to the port associated with the vSwitch groups. It is correctly stated in the vSphere API reference but incorrect in the version of vCO, which may indicate that the code real vCO is incompatible as well.

To recover a real populated HostPortGroup object you must descend through the successful HostNetworkInfo object; the portgroup here property is an array of the appropriate type.

Tags: VMware

Similar Questions

  • Calling a database procedure which returns the array as output parameters

    Hello


    I wanted to call a procedure that returns "T_Disponibilidad_Diaria".

    Type T_Disponibilidad_Diaria is Table of the R_Disponibilidad_Diaria
    INDEX OF DIRECTORY;


    Type R_Disponibilidad_Diaria is {Record

    }

    Please suggest me the best way to convert this type of array complex java object
    Thanks in advance


    Concerning
    Vidya

    But what you can do...

    Try to create a new stored procedure, which returns the type of the database object.
    In this procedure, you can call the original procedure.
    Take what it returns and make the type object. That's what you need to retrieve your procedure ;-) (.. .huh?)

  • Input processor may not return the array

    Hi all

    I've set up an EntryProcessor to return the results of the calculated amounts, however, under the exception is thrown when retrieving the result. Any idea? I tried to change to return BigDecimal instead of BigDecimal [], it works. Why?

    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.math.BigDecimal;


    BigDecimal results = (BigDecimal []) CacheHelper.getCounterPartyCache () .invoke (new FttCntptId("052753"), new CreateOrderProcessor());

    Henry

    922963 wrote:
    Hi all

    I've set up an EntryProcessor to return the results of the calculated amounts, however, under the exception is thrown when retrieving the result. Any idea? I tried to change to return BigDecimal instead of BigDecimal [], it works. Why?

    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; incompatible with [Ljava.math.BigDecimal;

    BigDecimal results = (BigDecimal []) CacheHelper.getCounterPartyCache () .invoke (new FttCntptId("052753"), new CreateOrderProcessor());

    Henry

    Hi Henry,.

    It can return the paintings, but he cannot return correctly typed arrays.

    On the client side, this table has been deserialized as an Object [] and not as a BigDecimal [] and, therefore, it cannot be cast to BigDecimal [].

    So just change the declaration of the Object [] results variable and do the distribution on the elements instead.

    Best regards

    Robert

  • Help returns the array of query results

    Hi all... Pretty new to this so please forgive my ignorance. Running Oracle 11 g, trying to return results as in the example I give below. I don't know how the Sport field will have unique values, and I don't know how many unique values the year field is seen in the data. Does anyone have recommendations/suggestions?

    The structure of the table is:
    Year of sport
    Baseball 10-11
    Football 10-11
    Football 11-12
    Football 11-12
    Football 11-12
    Baseball 11-12

    The result should be sports in each year and should be grouped by year but shown as columns so:
    (GROUP OF the year)
    1, baseball 1, Football
    2, 1, Football Soccer 1, Baseball


    I hope that makes sense. Thanks for any help!
    ... Kaelon

    Does anyone have recommendations/suggestions?

    Maybe something like:

    SQL> with t as (
     select 'Baseball' sport, '10-11' year from dual union all
     select 'Football', '10-11' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Football', '11-12' from dual union all
     select 'Soccer',   '11-12' from dual union all
     select 'Baseball', '11-12' from dual
    )
    --
    --
    select year, listagg(cnt || ', ' || sport, ' ') within group (order by cnt desc) sports from (
    select count(*) cnt, sport, year from t
    group by sport, year)
    group by year
    /
    YEAR    SPORTS
    ------- ----------------------------------------
    10-11   1, Baseball 1, Football
    11-12   2, Football 1, Baseball 1, Soccer       
    
    2 rows selected.
    

    ?

  • function to return the array of strings, a given string

    Hi all

    someone at - it a procedure/function of relaible, which takes a string like "a |" b | c | d | e' and retrun me a table IE [a, b, c and d, e] so I can loop throug the table and do stuff?

    Cheers in advance

    Concerning

    Satnam

    Hi, Michel,.

    You can loop through the string itself and do things.

    FOR  j IN 1 .. ( LENGTH (txt) -          -- In Oracle 11, use REGEXP_COUNT instead
                          LENGTH (REPLACE ( txt
                          , '|'
                         )
                   )
                ) + 1
    LOOP
         this_item := REGEXP_SUBSTR ( txt
                                , '[^|]+'
                           , 1
                           , j
                           );
         ...
    END LOOP;
    
  • Return an array of strings of call library function node

    Hello

    I'm having a few problems getting the following work.

    I have a camera from a manufacturer that came with its own .dll and header files. I'm calling the LabVIEW .dll file (2011). In total, there are about 50 functions, and there is a rest that I can't go to work (probably because I understand enough about the topic to interface with an external code).

    The description of .dll is delivered with the following text:

    #define length

    #define MAX_CONFIGURATIONS

    Prototype: int ConfigListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    and the header file with:

    extern "C" __declspec (dllexport) int RepRateConfigurationListGet (char (& sConfigurations) [MAX_CONFIGURATIONS] [length]);

    The function should return an array of strings to the list of configurations.

    The problem I have is that I can not understand how to return the array of strings for the node of the library function call to LabVIEW. I looked a little on the web and the examples in LabVIEW and I can't find anything specific to return an array of strings in this way, so if anyone can point me in the right direction I would really appreciate it.

    Also, if I click with the right button on the node library function call and click on "File Create.c", I would be able to create the prototype of function even that above? I tried this but no luck. Was the closest I came:

    int32_t RepRateConfigurationListGet (char sConfigurations [], uint8_t MAX_CONFIGURATIONS, uint8_t MAX_LEN);

    Thank you very much in advance for any help!

    D

    Hello!

    I tried once using an array of U8, converting it to a string and then split into an array.

    Here is my old piece of code (the split part can be cleaner ;=))

    Kind regards

    Marco

  • How to return the QML C++ bb::cascades:Control as a property object?

    Hi all

    I need to return the value of the property QML in C++ code, problem is that this value is object of bb::cascades:Control

    Look at the example:

    import bb.cascades 1.2
    
    Page {
     property NavigationPane currentNavigationPane: tab1.navHandle
     property int testprop:0
    }
    

    In C++, I need to retrieve the value of currentNavigationPane property (I suppose it must point to NavigationPane *)

           QVariant const   prop=__current_page->property("currentNavigationPane");
            NavigationPane* nav_p=prop.value();
            if (nav_p!=NULL){
                qDebug()<<"nav_p is not NULL";
            }
            qDebug()<
    

    As a result of this code: nav_p is the null pointer and app crashes without any note of debugging on qDebug()<>

    I found the solution by Exhibitor class c ++ in QML and I can call its methods with pointer to bb::cascades:Control as a parameter

    QML

    Page {
    id:this_page
        onCreationCompleted: {
            mainCPP.UpdatePage(this_page);
        }
    }
    

    C++

    Q_INVOKABLE void UpdatePage(bb::cascades::Page *call_back_page){
    if(call_back_page){
    qDebug()<<"Page is valid";
    }
    }
    

    By this method, I can use control of Cascade in C++

     

  • How to get the property of the object by it's string name

    Hi all!

    There is a function that receiver of the string value = "propertyName", which is the name of the property.

    and I have an element object with the name property is equal to "propertyName".

    How can I get to the element ofvalue of this property?

    I know that

    ObjectUtil.getClassInfo (element) .properties

    Returns an array of the properties of the element, but it's an easier way to do instead to search the table ditch?

    Thank you, Alex.

    the mounting of the parent of the object:

    var yourObject:DisplayObject = getChildByName ("propertyName");

  • Returns the name of the object in a table

    Hello

    I received the canvas of the objects stored in a table. Each painting has its name property.

    Is it possible to return a specific name?

    Actually I need an index number of this table, where I spend a name property of the object within this table (the name is taken from the event). Something like this:

    x = array.indexOf (canvasName = event.currentTarget.name)

    Why can't you just to target the instance?  It's enough to tell the difference between different objects.

    x = array.indexOf (event.currentTarget);

  • indexOf() function for search object. &lt; property &gt; in an array of objects

    Hello world!
    OK, I know that the subject of this sounds a little awkward wire, with an example, it will be much clearer.
    I have a series of tables that contain strings, now named "label"; These tags can only produce only once in each table (which is therefore a 'set' of the mathematical definition of 'package', tags), but more than one table may contain a given tag (intersections of the sets are not always zero).
    I want to write a function that goes through all the tags in all tables and counties, which gives the result in a separate table called tag_counter that contains the objects of the tag. A tag object contains two fields: 'value', which is the tag itself, and 'events', which takes account of the time the tag was found.
    The function logic is simple: for each table, cycle all its labels. If the tag already exists in the tag_counter table, increment the counter 1; If not, add a new entry in the table with the given tag tag_counter. The line in bold-italics is exactly in the place of my question, because I don't know how to search within an array of objects by a property of such an object. Here is the code:

    private function harvest_tags(dt:DataTable):Array {
        var tag_counter:Array = new Array();
        
        for each(var site_feeds:Object in dt.data) {    //cycle through the Arrays
            for each(var tag:String in site_feeds.t) {  //cycle through the tags
                if(tag == '') continue;     //in case an empty tag is found, skip it
                tag = tag.replace(',', ''); //strip commas
                var i:int = tag_counter.indexOf(tag); //this needs fixing!
                if(i != -1) {
                    tag_counter[i].occurrences++;
                 }
                else {
                     tag_counter.push(new Tag(tag));
                 }
             }
         }
    
         tag_counter.sortOn("occurrences", Array.NUMERIC | Array.DESCENDING);
         return tag_counter;
    }
    

    and the class of tag definition:

    public class Tag {
            private var value:String;
            public var occurrences:Number;
            
            public function Tag(value:String) {
                this.value = value;
                this.occurrences = 1;
            }
    }
    

    Any help would be greatly appreciated.

    Andrea

    I think you want to use a hash table.  The object class is often used for this.  It is much faster than searching for an array of strings.

    private void harvest_tags(dt:DataTable):Array {}

    var tag_counter:Object = new Object();

    for each (var site_feeds:Object in dt.data) {//cycle through the berries

    for each (var: string tag in site_feeds.t) {//cycle by tags

    if(tag == '') continue;     where is an empty tag, pop it

    tag = tag.replace (',', "); Strip commas

    If (tag_counter [tag])

    tag_counter [tag] ++;

    on the other

    tag_counter [tag] = 1;

    }

    }

    var tag_array:Array = new Array();

    for {(var p:String in tag_counter)

    var tagObj:Tag = new Tag (p);

    tagObj.occurences = tag_counter [p];

    }

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • The value of property to an array element node: How does it work?

    As I tried in vain to understand my shipment of samples recent misconception (here), I came across a behavior that I'm not sure I understand.

    Here it goes:

    Move a table of numeric values to the FP show. a few items. The easiest way is to take a 'table - Numeric (Silver)' pre-formed object with 3 items listed.

    Now, right-click on the top element and select: create > property node > value

    Change this to write about the BD and to connect a constant, say 1. Run the VI, you get this:

    ===>

    So far so good.

    Now do the same for the THIRD item and wire a different constant to the AP, say 3. Rerun the VI, you get this:

    ===>

    All right...

    I mean, it is not already made a lot of sense, but wait what will happen...

    Now remove the first NP and run VI again:

    ===>

    Quite logical, right? ... not!

    At least * I * can't make sense of it and it smells like a bug to me... or a weird feature.

    Tested in LV 2013 SP1 (62 + 2 bits) on Windows 7 64 bit.

    You create a shortcut to write to the ArrElem.Value property.  The property ArrayElement to a table is a little funky, it is the last element that was active.  With only a single PN on your comics in writing a value, click in the central element of the array, and then run the VI, repeat for the other elements.

  • HypGetMemberInformation in VBA. Does not return the property values.

    I tried to use HypGetMemberInformation in VBA to find the level of a member of the grid.

    I continued to get zeros even for members who are not level 0 ones.

    I went to test HypGetMemberInformation a test connected grid that has members in the first column (column A).

    I packed a test routine I ran after you connect the grid manually:

    Void TestMemberLevelFind()

    Dim line As Integer

    Dim MemberProperties Collection As

    Dim vtMemberName As String

    ' Dim vtPropertyName As String

    Dim vtPropertyValue As Long

    Dim vtPropertyValueString As String

    Dim ErrorCode as long

    Dim ErrorMessage As String

    Define MemberProperties = new Collection

    MemberProperties.Add HYP_MI_NAME

    MemberProperties.Add HYP_MI_DIM

    MemberProperties.Add HYP_MI_LEVEL

    MemberProperties.Add HYP_MI_GENERATION

    MemberProperties.Add HYP_MI_PARENT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CHILD_MEMBER_NAME

    MemberProperties.Add HYP_MI_PREVIOUS_MEMBER_NAME

    MemberProperties.Add HYP_MI_NEXT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CONSOLIDATION

    MemberProperties.Add HYP_MI_IS_TWO_PASS_CAL_MEMBER

    MemberProperties.Add HYP_MI_IS_EXPENSE_MEMBER

    MemberProperties.Add HYP_MI_CURRENCY_CONVERSION_TYPE

    MemberProperties.Add HYP_MI_CURRENCY_CATEGORY

    MemberProperties.Add HYP_MI_TIME_BALANCE_OPTION

    MemberProperties.Add HYP_MI_TIME_BALANCE_SKIP_OPTION

    MemberProperties.Add HYP_MI_SHARE_OPTION

    MemberProperties.Add HYP_MI_STORAGE_CATEGORY

    MemberProperties.Add HYP_MI_CHILD_COUNT

    MemberProperties.Add HYP_MI_ATTRIBUTED

    MemberProperties.Add HYP_MI_RELATIONAL_DESCENDANT_PRESENT

    MemberProperties.Add HYP_MI_RELATIONAL_PARTITION_ENABLED

    MemberProperties.Add HYP_MI_DEFAULT_ALIAS

    MemberProperties.Add HYP_MI_HIERARCHY_TYPE

    MemberProperties.Add HYP_MI_DIM_SOLVE_ORDER

    MemberProperties.Add HYP_MI_IS_DUPLICATE_NAME

    MemberProperties.Add HYP_MI_UNIQUE_NAME

    MemberProperties.Add HYP_MI_ORIGINAL_MEMBER

    MemberProperties.Add HYP_MI_IS_FLOW_TYPE

    MemberProperties.Add HYP_MI_AGGREGATE_LEVEL

    MemberProperties.Add HYP_MI_FORMAT_STRING

    MemberProperties.Add HYP_MI_ATTRIBUTE_DIMENSIONS

    MemberProperties.Add HYP_MI_ATTRIBUTE_MEMBERS

    MemberProperties.Add HYP_MI_ATTRIBUTE_TYPES

    MemberProperties.Add HYP_MI_ALIAS_NAMES

    MemberProperties.Add HYP_MI_ALIAS_TABLES

    MemberProperties.Add HYP_MI_FORMULA

    MemberProperties.Add HYP_MI_COMMENT

    MemberProperties.Add HYP_MI_LAST_FORMULA

    MemberProperties.Add HYP_MI_UDAS

    ' For line 8 to 83 =

    For row = 8-10

    vtMemberName = ThisWorkbook.ActiveSheet.Cells (rank 1). Value

    For each vtPropertyName in MemberProperties

    Code of error = HypGetMemberInformation(ThisWorkbook.ActiveSheet.Name, vtMemberName, vtPropertyName, vtPropertyValue, vtPropertyValueString)

    If ErrorCode = 0 Then

    MsgBox _

    "The worksheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property value:" & vtPropertyValue & Chr (13) & _ "."

    "The property string:" & vtPropertyValueString ".

    On the other

    ErrorMessage = GetReturnCodeMessage (ErrorCode)

    MsgBox "SmartView API function HypGetMemberInformation returned an error message:" & Chr (13) & ErrorMessage, vbOKOnly, PrivateConnectionDescription

    End If

    Next

    On the next row

    End Sub

    The routine produces no result expected.

    Only of zeros.

    For all properties and all members.

    There must be something fundamentally wrong with my code.

    The function arguments are correct with regard to the name of journal, the member name and property name.

    Value of the property is always 0 and the property value string is always empty.

    Two property value arguments are expected to be passed by reference, so I should get some useful information.

    No error is generated so that the return error code is always 0.

    I guess that some prerequisite so that this function is not satisfied, but what is?

    Concerning

    Problem solved.

    The cause of all evil, as ususal, type mismatch...

    Arguments by reference:

    vtPropertyValue, vtPropertyValueString

    must be declared as variants but returned it to the values are ARRAYS...

    After the function call, to loop through these berries extract the real info returned!

    In the case of unique value of parameters such as the level of Member just use index 0, for example:

    vtPropertyValue (0)

    The corrected code is less with parts modified trhe parked in Green:

    Void TestMemberLevelFind()

    Dim line As Integer

    Dim index As Integer

    Dim MemberProperties Collection As

    Dim vtMemberName As String

    Dim vtPropertyName As Variant

    Dim vtPropertyValue As Variant

    Dim vtPropertyValueString As Variant

    Dim ErrorCode as long

    Dim ErrorMessage As String

    Define MemberProperties = new Collection

    MemberProperties.Add HYP_MI_NAME

    MemberProperties.Add HYP_MI_DIM

    MemberProperties.Add HYP_MI_LEVEL

    MemberProperties.Add HYP_MI_GENERATION

    MemberProperties.Add HYP_MI_PARENT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CHILD_MEMBER_NAME

    MemberProperties.Add HYP_MI_PREVIOUS_MEMBER_NAME

    MemberProperties.Add HYP_MI_NEXT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CONSOLIDATION

    MemberProperties.Add HYP_MI_IS_TWO_PASS_CAL_MEMBER

    MemberProperties.Add HYP_MI_IS_EXPENSE_MEMBER

    MemberProperties.Add HYP_MI_CURRENCY_CONVERSION_TYPE

    MemberProperties.Add HYP_MI_CURRENCY_CATEGORY

    MemberProperties.Add HYP_MI_TIME_BALANCE_OPTION

    MemberProperties.Add HYP_MI_TIME_BALANCE_SKIP_OPTION

    MemberProperties.Add HYP_MI_SHARE_OPTION

    MemberProperties.Add HYP_MI_STORAGE_CATEGORY

    MemberProperties.Add HYP_MI_CHILD_COUNT

    MemberProperties.Add HYP_MI_ATTRIBUTED

    MemberProperties.Add HYP_MI_RELATIONAL_DESCENDANT_PRESENT

    MemberProperties.Add HYP_MI_RELATIONAL_PARTITION_ENABLED

    MemberProperties.Add HYP_MI_DEFAULT_ALIAS

    MemberProperties.Add HYP_MI_HIERARCHY_TYPE

    MemberProperties.Add HYP_MI_DIM_SOLVE_ORDER

    MemberProperties.Add HYP_MI_IS_DUPLICATE_NAME

    MemberProperties.Add HYP_MI_UNIQUE_NAME

    MemberProperties.Add HYP_MI_ORIGINAL_MEMBER

    MemberProperties.Add HYP_MI_IS_FLOW_TYPE

    MemberProperties.Add HYP_MI_AGGREGATE_LEVEL

    MemberProperties.Add HYP_MI_FORMAT_STRING

    MemberProperties.Add HYP_MI_ATTRIBUTE_DIMENSIONS

    MemberProperties.Add HYP_MI_ATTRIBUTE_MEMBERS

    MemberProperties.Add HYP_MI_ATTRIBUTE_TYPES

    MemberProperties.Add HYP_MI_ALIAS_NAMES

    MemberProperties.Add HYP_MI_ALIAS_TABLES

    MemberProperties.Add HYP_MI_FORMULA

    MemberProperties.Add HYP_MI_COMMENT

    MemberProperties.Add HYP_MI_LAST_FORMULA

    MemberProperties.Add HYP_MI_UDAS

    ' For line 8 to 83 =

    For row = 8-10

    vtMemberName = ThisWorkbook.ActiveSheet.Cells (rank 1). Value

    For each vtPropertyName in MemberProperties

    Code of error = HypGetMemberInformation (ThisWorkbook.ActiveSheet.Name, vtMemberName, vtPropertyName, vtPropertyValue, vtPropertyValueString)

    If ErrorCode = 0 Then

    If IsArray (vtPropertyValue) then

    For index = LBound (vtPropertyValue) to UBound (vtPropertyValue)

    MsgBox _

    "The sheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property" & index & "value table:" & vtPropertyValue (index) & Chr (13) & _

    "Property" & index & "string array:" & vtPropertyValueString (index)

    Next

    On the other

    MsgBox _

    "The sheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property value:" & vtPropertyValue & Chr (13) & _ "

    "The property string:"& vtPropertyValueString"

    End If

    On the other

    ErrorMessage = GetReturnCodeMessage (ErrorCode)

    MsgBox "SmartView API function HypGetMemberInformation returned an error message:" & Chr (13) & ErrorMessage, vbOKOnly, PrivateConnectionDescription

    End If

    Next

    On the next row

    End Sub

    Fortunately we can someone find this useful.

    I wish documentation Oracle was a little clearer with more extensive code examples.

    Gustaw

  • by passing the array of objects to the procedure

    Hi, I wrote a procedure to accept the array of input objects. It has worked well.

    This is the only setting of entry in my Interior.

    But now, I tried to add a off set the parameter of type varchar2 to my procedure to send a return value, but it gives me an error

    PLS-00410: fields in duplicate in the FOLDER list, TABLE or argument are not allowed.

    Please suggest cant I pass all other arguments when using an array of record or an object as a parameter?

    This is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    
     PREF_CD  varchar2(20),
     USR_ID   VARCHAR2(20),
     PROD_CD  VARCHAR2(50),
     DFLT_PREF_VAL_TX VARCHAR2(250),
     USR_PREF_VAL_TX VARCHAR2(250),
     CRE_USR_ID VARCHAR2(20),
     UPDT_USR_ID VARCHAR2(20) );
    /
    
    
    
    
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
     
    
    begin
    
    for i in  in_pref.first.. in_pref.last
    
    LOOP
    
    /* Derive the product and user dim numbers */
    
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    
    
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    if v_count=0 then 
    
    BEGIN
    
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    
    
    
    END;
    
    else 
    
    
    
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where 
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    
    end if;
    
    
    end loop;
    
    commit;
    
    v_err:='abc';
    
    end;
    /
    Published by: raj_fresher on October 9, 2009 06:56

    Why the 6001 number is assigned to the error code? Oracle generates error code right... Why the procedure does not use this number move like to help put
    r_v_errod_cde and r_v_error_msg?

    I don't know who wrote at the beginning of this procedure, but no doubt he wanted to use some 'custom error handling?
    Furthermore, I don't see anything happening with R_V_ERROR_CODE and R_V_ERROR_MSG, or did you leave this part out of your snippet?
    This way of using a WHEN of OTHER (not followed by a RAISE) is considered to be a 'bad practice' / a bug.

  • How to change the value of the array element by using the property node

    Hello all :)

    IM using a table in the drop-down list box. the size of the array is not fixed.

    I want property strings [] from the drop-down list box to enter text in selection, but since I placed it inside the table im unable to use this property.

    I used 'arrayelem' reference property and property node connected to it but got no strings [] in the selection.

    so is it possible that I can use property strings]


  • a node property to return the configuration of the task a DAQmx

    Tasks in this project are preconfigured in MAX, but once the operator needed to enter and change the sampling frequency, that I would like to add a routine to start to check the sampling rate of the configured tasks. I know that using a DAQmx property node can return task names and channel names, but what I could use is a property node to return the sampling frequency of the task. A knowledge of a way to do this?

    If you place a property on the block schema node, connect it to your task control. Right-click on the property node, and then select the DAQmx Timing (class select DAQmx-> DAQmx Timing). Then select the sample-Rate property > clock.

Maybe you are looking for