How to get the 'index' of an associative array?

Hello

Is it possible to get the 'index' of an associative array?

I saw say about 3000 ID.

Corresponding to each of these identifiers, thre is a 'key' (the 'key' can repeat for different ID)... tell key1, key2, key3.

Now, I want to show the top of page 8 keys ().

Could you please tell me how can I do this?

Concerning

Don't know what you are exactly looking for.

To get the index of an array of assotiative you should do something like

SQL> declare
   type arr is table of number
                  index by varchar2 (5);

   var   arr;
   idx   varchar2 (5);
begin
   --  fill the array
   for id in 1 .. 12
   loop
      var ('key' || to_char (id, 'fm00')) := id;
   end loop;

--  get the keys
   idx := var.first;
   dbms_output.put_line (idx);

   while idx is not null
   loop
      idx := var.next (idx);
      dbms_output.put_line (idx);
   end loop;
end;
/
key01
key02
key03
key04
key05
key06
key07
key08
key09
key10
key11
key12
PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • How to get the index of the selected field

    I create a ListField with field 2

    MyListField myList = new MyListField(app);
    MyListFieldCallback myCallback = new MyListFieldCallback();
    myList.setCallback(myCallback);            
    
    String field1 = new String("Division 1");
    String field2 = new String("Division 2");       
    
    myList.insert(0);
    myCallback.insert(field1, 0);
    myList.insert(1);
    myCallback.insert(field2, 1);
    myList.insert(2);
    

    I replaced navigationClick and I want to get the index of the field when the navigationClick is called

    public class MyListField extends ListField {
        public MobileApplication app;
    
        MyListField(MobileApplication app) {
            this.app = app;
        }
        protected boolean navigationClick(int status, int time) {
        if ((status & KeypadListener.STATUS_TRACKWHEEL) != KeypadListener.STATUS_TRACKWHEEL) {
            selectionPerformed();
            return true;
        }
            return super.navigationClick(status, time);
        }
        private void selectionPerformed() {
                    // HERE I WANT TO GET THE INDEX OF THE FIELD SELECTED
    
            app.popScreen(app.getActiveScreen());
        }
    }
    

    What code is needed where I have comments?

    Use ListField::getSelectedIndex

    -Maury.

  • How to get the index of color framed in framed color box table 2 D box control

    Hello

    In project, I want to show the different status (Std, TIP, success & failure) with different colors for 200 boxes of colors arranged in a 20 X 10 (table 2 D). When the user clicks on one of the array element, I want to show the details, so I want the index of the element. How can I get?

    Thank you

    Shrinivas

    http://forums.NI.com/T5/LabVIEW/identify-which-array-index-and-cluster-element-has-been-clicked/m-p/...

  • How to get the index of the step of a market...?

    Hello...

    I want to put the RunState.NextStepIndex. I don't want to encode the value. I want to get the stepIndex of a particular step dynamically so that even if the steps are moved I always go to the same step. How can I get the stepIndex of any stage...? should what method I use...?

    Once you have a reference to the sequence, you can call GetStepIndex.

    Method GetStepIndex

    Syntax

    Sequence. GetStepIndex (nameOfStep, stepGroupParam)

    Return value

    long

    Returns the index of the step with the name that matches the name that you specify. Returns - 1 if no such process exists.

    Goal

    Returns the index of the step with the name that matches the name that you specify.

    Parameters

    nameOfStep String

    [In] The name of the step that you want the index of. If there are several steps using the same name in the group stage, the method returns the index of the first stage of this name. Name comparison is case-insensitive. You can also pass a single step ID.

    stepGroupParam As StepGroups

    [In] Specifies a given market group.

    Hope helpls,

  • How to get the index of the selected items in a listbox?

    I chose several items in a list box, but I can't extract the index.

    How can I do?

    Hello iCat

    If you have listobox in the mode of data table type, it simply returns the table of the selected index.

  • How to get the index of element of constant of cluster

    Is it possible to programmatically determine the index (order) of a particular item in a constant of cluster (typedef)?  The cluster is a group of commands, using the control [] array is not an option.

    It seems that this would be an operation of property, but as there are a no "references" for control objects (is there?), there is no properties of control objects.  I use clusters of risk much.  I struggled with the same problem trying to retrieve cluster of clusters of control element names (all roads lead to OpenG :-) don't want to install VIPM :-().

    I use a digital video recorder with a bunch of berries to share data between an application and use in the structures of the element of the Place to read/write tables. Each table (all the bool or slna) represents an array of values to write to the output of the modules (digital and analog).  Usually I only update tables in a loop and read in several screws/loops.

    From the beginning, I stored the data in table form, but later in development, I created typedefs of cluster for clarity when using the data in a FP VI (especially when you read the data in the table and the display on the indicators).

    The exception to the rule of write-once/read many is when I just want to set or clear a single bit BOOL.

    Attached is a picture showing 2 ways to do the same.

    The structure of the DVR read/write on the RIGHT illustrates how I currently updating a single element of an array of BOOL.  In particular, I want to bit - 2 a table named "bOutputCmds".  [bOutputCmds] is an element of a group named "IoCluster" and the "IoCluster" shared across the application by a DVR named 'IoDataRef '.  Safe to update the value of the wick requires 3 operation in Place (in Place DVR R/W in Place unbundle and in square array Index).

    It works very well.  However, the operation requires specifying the index of the little interest, in this case, "2".  I could assign constants for all the special bits, but it would seem more appropriate to enjoy for typedefs that I created. Typedefs allow me to make changes to assignments of IO and describe the configuration in one place.  DVR R/W element on the LEFT illustrates a way to update a single bit (safely) a cluster element name.

    Retrieve the index of the "bLoadEna" item (2) of the typedef of cluster used on the LEFT would make the solution on the much cleaner RIGHT.

    My backup is to replace all the paintings that I originally put in the cluster shared with the individual clusters later I so carefully set or replace all command non - clusters with clusters of the indicator. Or the other works perfectly. For the most part, I'm technically curious because I tend to bang against the limitations of the control clusters quite often.  I seem to be a programmer of NON-INTERFACE in a world of the user interface.

    In fact, my last statement was rhetorical, but it is really quite real.  My request is a controller shipped without a head, so I don't no need or use many controls.  Maybe I should think about some before picking on clusters of risk...

    Fact.

    Thank you

    Peter

    Use the tools of my favorite library, VariantDataType library, found at vi.lib\utility\VariantDataType, as shown:

    The functions used here are "GetClusterInfo" and "GetTypeInfo."

  • How to get the index of a button in the control array?

    Greetings,

    I have 3 parallel arrays - buttons containing a and the other two indicators a string containing.  I wish I could press a button and get the values in other tables.  How is that possible?

    (P.S.  Illustrations are great and welcome, but I don't have Labview on this computer, so I would appreciate in jpg or screenshots if possible.)

    Thank you!

    Altenbach says:

    Here's what I had in mind. Modify if needed.

    If you have the buttons to all wrong initalized, then you don't need to perform the do not equal to.  Just do a search with the NewVal.  The local variable to reset buttons must be wired to the OldVal.

  • How to get the index of the list column Mult box

    Hi all

    I need little help. Please help me.

    Is there is no property to dynamically change the index position of line "Multi column list box"?

    I want to change the index location when running as below.

    He called the top left cell Visible. There is no as many properties.

  • How to see the output of an associative array in procedure

    Hello
    I tried the following code
    And confused about the research at the exit of the associative array.
    CREATE OR REPLACE PACKAGE test_pak1
    AS
       FUNCTION map_object (obj_typ_in VARCHAR2)
          RETURN VARCHAR2;
    
       CURSOR c_c1
       IS
          SELECT * FROM emp;
    
       TYPE test_ttyp IS TABLE OF c_c1%ROWTYPE
                            INDEX BY PLS_INTEGER;
    
       PROCEDURE search_obj (obj_type VARCHAR2);
    END;
    
    CREATE OR REPLACE PACKAGE BODY test_pak1
    AS
       FUNCTION map_object (obj_typ_in VARCHAR2)
          RETURN VARCHAR2
       IS
       BEGIN
          dopl ('Hello');
          RETURN abc;
       END;
    
       PROCEDURE search_obj (obj_type VARCHAR2)
       IS
          test_tab   test_ttyp;
       BEGIN
            DOPL  (test_tab);
          end;
       END;
    In the above code, I want to see the output of the test_tab located in the search_obj procedure.

    could you please help me in this

    Thank you

    Hi, smile,

    If you want to see records, you must put the lines in your table. Here's a solution: in this solution, I only edit the search_obj procedure of your package like this:

     PROCEDURE search_obj (obj_type VARCHAR2)
       IS
          test_tab   test_ttyp;
          test_tab_r   c_c1%ROWTYPE;
       BEGIN
            --test_tab;
            --Here we put something in test_tab
            OPEN c_c1;
    
            LOOP
                 Fetch c_c1 into test_tab_r;
                 exit when c_c1%NOTFOUND;
                 test_tab(test_tab.COUNT + 1) := test_tab_r;
             END LOOP;
            CLOSE c_c1;   
    
            FOR i IN 1 .. test_tab.COUNT LOOP
              dbms_output.put_line(test_tab(i).empno);
           END LOOP;
    
       END;
    

    Here is the result:

    SQL> exec test_pak1.search_obj('parameter_not_used_in_the_procedure');
    7369
    7499
    7521
    7566
    7654
    7698
    7782
    7788
    7839
    7844
    7876
    7900
    7902
    7934
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • How to manage an INDEX vacuum Table (associative arrays)

    Hello Hello,

    I created the following query to retrieve the best employees n with the highest salary the filtering by the name of the service that they belong.

    Executes the stored procedure with values in line 10 is fine and the data is retrieved

    set serveroutput on;
    set verify off;
    
    declare 
    v_emp_table_ind_by Pkg_Types.emp_table_type;
    v_first_index_value pls_integer;
    v_last_index_value pls_integer;
    v_emp_rec Pkg_Types.vt_emp_rec;
    BEGIN 
    Top_N_Employees_By_Salary( n => 2,v_tbl_emp_rec => v_emp_table_ind_by,v_department_name=>'Fin');
    FOR i IN v_emp_table_ind_by.FIRST .. v_emp_table_ind_by.LAST
    LOOP
        v_emp_rec := v_emp_table_ind_by(i);
        dbms_output.put_line('Employee Code : ' || v_emp_rec.employee_id || CHR(13) || CHR(10) ||
                          'Name : ' || v_emp_rec.first_name || CHR(13) || CHR(10) ||
                          'Last Name : ' || v_emp_rec.last_name || CHR(13) || CHR(10) ||
                          'Salary : ' || v_emp_rec.salary || CHR(13) || CHR(10) ||
                          'Department : ' || v_emp_rec.department_name || CHR(13) || CHR(10) 
                          );
    END LOOP;
    END;
    

    Results showed after executing the above statement

    anonymous block completed
    Employee Code : 112
    Name : Jose Manuel
    Last Name : Urman
    Salary : 7800
    Department : Finance
    
    Employee Code : 113
    Name : Luis
    Last Name : Popp
    Salary : 6900
    Department : Finance
    
    

    Changing the value for the parameter v_department_name to "Finx' instead of 'end '.

    Top_N_Employees_By_Salary( n => 2,v_tbl_emp_rec => v_emp_table_ind_by,v_department_name=>'Finx');
    

    The following error message is displayed because no documents have not been found.

    Error starting at line : 4 in command -
    declare 
    v_emp_table_ind_by Pkg_Types.emp_table_type;
    v_first_index_value pls_integer;
    v_last_index_value pls_integer;
    v_emp_rec Pkg_Types.vt_emp_rec;
    BEGIN 
    Top_N_Employees_By_Salary( n => 2,v_tbl_emp_rec => v_emp_table_ind_by,v_department_name=>'Finx');
    FOR i IN v_emp_table_ind_by.FIRST .. v_emp_table_ind_by.LAST
    LOOP
        v_emp_rec := v_emp_table_ind_by(i);
        dbms_output.put_line('Employee Code : ' || v_emp_rec.employee_id || CHR(13) || CHR(10) ||
                          'Name : ' || v_emp_rec.first_name || CHR(13) || CHR(10) ||
                          'Last Name : ' || v_emp_rec.last_name || CHR(13) || CHR(10) ||
                          'Salary : ' || v_emp_rec.salary || CHR(13) || CHR(10) ||
                          'Department : ' || v_emp_rec.department_name || CHR(13) || CHR(10) 
                          );
    END LOOP;
    END;
    Error report -
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 8
    06502. 00000 -  "PL/SQL: numeric or value error%s"
    *Cause:    
    *Action:
    
    

    How can I handle this error?

    The code

    PACKAGE Pkg_Types

    Top_N_Employees_By_Salary

    Now easier to solve (if your array is dense, initialized and begins so filled with 1's):

    I'm in 1.v_emp_table_ind_by.count)

    loop

    ...

    end loop;

    no need to check with an IF statement - if there are elements in it. Count returns 0 if empty (initialized) array and a loop of 1.0 is valid and has simply nothing.

    HTH

  • Get the index of the current page?

    Hello, I can't understand, how to get the index of the current Page in a document. I can't use "activePage.name" as the name cannot show the actual number of the current page. In the forums, I found the following function for javascripts indexOf() function.

    If (!.) Array.prototype.indexOf) {}

    Array.prototype.indexOf = function (searchElement / *, fromIndex * /) {}

    "use strict";

    If (this == null) {}

    throw new TypeError();

    }

    var t = Object (this);

    var len = Extremity > > > 0;

    If (len = 0) {}

    Returns - 1;

    }

    var n = 0;

    If (arguments.length > 0) {}

    n = Number (arguments [1]);

    If (n! = n) {/ / shortcut to check if it is NaN}

    n = 0;

    } Else if (n! = 0 & & n! = Infinity & & n! = - infinite) {}

    n = (n > 0 |-1) * Math.floor (Math.abs (n));

    }

    }

    If (n > = len) {}

    Returns - 1;

    }

    var k = n > = 0? n: Math.max (len - Math.abs (n), 0);

    for (; k < len; k ++) {}

    If (k t & & t [k] = searchElement) {}

    return k;

    }

    }

    Returns - 1;

    }

    }

    With that, I then wrote the following code:

    myDocument var = app.activeDocument;

    myPages var = myDocument.pages;

    var number = myPages.indexOf(myDocument.layoutWindows[0].activePage);

    Unfortunately, it does not work. When I warn "myPages" I can see, I get the pages object. I know somehow get just the array with the values of the present?

    Thank you in advance! Appreciate any help!

    app.activeWindow [0].activePage.documentOffset

    Of course, documentOffset, no index. Thank you for noticing.

  • How to get the tab page index active?

    I have a parent tab and the number of child tab

    I want to get the index of the active tab page, normally I would do this:

    Is there a direct approach?

    Image EDITING

    Just read the value of the Terminal.

  • How to get the name of the particular index table option.

    Hello

    Can any body tell how to get the name of the item to a particular array.i have a table within array.i must compare the name of Francesca in particular key.here is the table.

    myArray= Array (@43b1e09)
    [0] = object (@42b33f9)
    Testing_1 = Array (@4428821)
    [0] = object (@43adc19)
    choice_id = '0 '.
    delete = "N".
    DownloadURL = "xyz".
    selected = 'Y '.
    translation = "2_486."
    length = 1
    length = "N".
    Editable = 'Y '.
    field_id = '388 '.
    LanguageLink = 'Y '.
    linked_definition_id = null
    multiple values = "N".
    name = "Photo".
    otheroption = "N".
    photovitlink = object (@43ad0d9)
    required = "N".
    step = '1 '.
    translation = "Photo".
    visible = 'Y '.
    [1] = object (@43ad5d9)
    [2] = object (@4490089)

    Here is the structure of the table I get server side.i give table name of result as table myArray.This have several child as an object of object.each having .i table (Testing_1 in the first case) must get the name of this Testing_1 table and compare with my sort key that I perform an operation. But I am unable to get the name of this Testing_1 array(Since_it_is_dynamic_so_this_name_changes_some_times).can a body guide me how to get the name of this table.



    Thanks and greetings

    Vineet Sharma

    Hi Vineet Osho,

    You can browse your object using the loop and you can get the name of the table... as below...

    for each (var obj:Object in myArray)
    {
    for (var str:String in obj)
    {
    If (obj [str] is array)
    {
    var arrayName:String = str;
    }
    }
    }

    Thank you

    Jean Claude

  • get the index of a selected item in a drop-down list box

    Hello

    If I have a list of strings in a drop-down list box and the user selects one in the drop-down menu, how can I get the index?  I was able to explore the table for the selected channel, but it seems like duplication of effort to create a list and then go back and research it.

    Thank you

    Brendon

    It's easier to change control of the ring or Enum which gives the index as a default value, a drop-down list box gives a string that must be converted. But if you like really graphic and you want to use the drop-down list you can uncheck the "use strings as values" option and enter the index as numbers and then make a string to Decimal conversion.

    /Y

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

Maybe you are looking for

  • Upgrade processor E50

    Hello I have a Celeron D processor in my 8773 59 E50. Where the possibilities of processor upgrade? TIA

  • PID control tools installation problem

    Hello I installed the PID control toolset and a message indicating that: "Error 1401. Could not create key. S...\Software\Microsoft. Check that you have sufficient access to that key, or contact your support staff. » Do you know what I have to do? Th

  • How can I download vidios from iphone to pc

    I have an iphone 4S. I am trying to download the video for windows xp. I do not understand how

  • Shortcuts in Windows Vista

    When you type e-mail, a new tab opens whenever the letter 'T' is reached. Also seems to be some shortcuts introduced when various keys are affected. Very frustrating and cannot understand why this happens. Also in the case of Word, often together sen

  • I can't install avalon hills third riech on windows vista

    When I try to install it says that my it cannot run full-screen mode. I tried to change to windows 95 and windows xp compability mode but no dice. I also tried run as admin, once again no dice. can anyone help?