Trying to get a value from 1 array based off the ID in another

Something like this.
rankGrade = model.rankArray.RANKABBRIVIATION where
model.rankArray.RANKGRADEID = model.student.RANKGRADEID
Any suggestions?

You could use associative arrays, or even better to use XML
with e4x syntax. See these FB3 help topics:
Associative arrays
The E4X approach to XML processing
myXML.item.(menuName=="small fries").@quantity = "2";

Similar Messages

  • Get distinct values from plsql array

    Hi,
    I have declared a variable as below in plsql proc.
    type t_itemid is table of varchar2(10);
    inserted set of items in to this using a program
    now i want distinct values from that array how can i get it.

    I am using 9i so i cannot use set operator and more over my problem is that i am declaring the variable inside the plsql block . when i tried i am getting the below errors:
    SQL> r
    1 declare
    2 type t_type is table of varchar2(10);
    3 v_type t_type;
    4 begin
    5 v_type := t_type('toys','story','good','good','toys','story','dupe','dupe');
    6 for i in (select column_value from table(v_type)) loop
    7 dbms_output.put_line(i.column_value);
    8 end loop;
    9* end;
    for i in (select column_value from table(v_type)) loop
    ERROR at line 6:
    ORA-06550: line 6, column 41:
    PLS-00642: local collection types not allowed in SQL statements
    ORA-06550: line 6, column 35:
    PL/SQL: ORA-22905: cannot access rows from a non-nested table item
    ORA-06550: line 6, column 10:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 7, column 22:
    PLS-00364: loop index variable 'I' use is invalid
    ORA-06550: line 7, column 1:
    PL/SQL: Statement ignored

  • Get numerical values from 2D array of string

    Hello! 
    I start by saying that I have a base knowledge of LabView. I'm using LabView 2011. I'm doing some communications test via Can-Bus protocol. As you can see in pictures of the block diagram and of the front panel that I've attached I'm using "Transmit Receive same Port" LabView example. It works very good but I would need to insert the 8 data bytes that I receive from the server in 8 different numerical variables so that I could use them to make some operations. How can I get numerical values from the 2D array of string that I attached? 
    Every example that you can provide is important! 
    Thank you very much! 
    Attachments:
    1.jpg ‏69 KB
    2.jpg ‏149 KB

    Hi martiflix,
    ehm: to unbundle data from a cluster I would use the function Unbundle(ByName)…
    When you are new to LabVIEW you should take all the FREE online resources offered by NI on their website!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to get a value from an array in a nested loop

    Hi
    I have an array inside a four loop. The for loop (it is supposed to run 4 times) is further inside a while loop. The array consists of four elements and the values each of these elements are fed before running the program. To receive the values of each of these elements one by one outside the for loop, I am using the function index array. To receive all the values one by one, I created a shift register and wired the output of the index arrray to it. The problem is that instead of receiving all the values one by one, I am receiving only the value in the fourth
    element of the array...Can someone please help me..

    The attached file is my program.
    Attachments:
    Value from array.vi ‏25 KB

  • Trying to get export value from combo box

    Using the "Custom Keystroke Script" for a combo box:
    // This works but gives the current face value
    if( event.willCommit )
        app.alert(event.value);
    // This works but gives the previous export value
    if( event.willCommit )
        app.alert(event.target.value);
    What I need is the clicked items' current export value as soon as it is clicked.
    What am I doing wrong?

    Sorry about that. I posted the question and then realized I should have just used the same thread.
    Any way, I tried your code and it does not show the current export value. It shows the previously selected value.
    Example:
    When I click item 2 it shows item 0
    Then I click item 4 and it shows item 2
    Then I click item 7 and it shows item 4.. etc.. (see the pattern)
    What I need is the value from the item I'm currently clicking on.
    If I click item 2, I expect to see item 2. etc..
    Thank you for your patience in answering this!

  • Selecting random values from an array based on a condition

    Hi All,
    I have a small glitch here. hope you guys can help me out.
    I have an evenly spaced integer array as X[ ] = {1,2,3, ....150}. and I need to create a new array which selects 5 random values from X [ ] , but with a condition that these random values should have a difference of atleast 25 between them.
    for example res [ ] = {2,60,37,110,130}
    res [ ] = {10,40,109,132,75}
    I have been thinking of looping thru the X [ ], and selecting randomly but things look tricky once I sit down to write an algorithm to do it.
    Can anyone think of an approach to do this, any help will be greatly appreciated ...

    For your interest, here is my attempt.
    import java.util.Random;
    public class TestDemo {
        public static void main(String[] args) throws Exception {
            for (int n = 0; n < 10; n++) {
                System.out.println(toString(getValues(5, 25, 150)));
        private final static Random RAND = new Random();
        public static int[] getValues(int num, int spread, int max) {
            if (num * spread >= max) {
                throw new IllegalArgumentException("Cannot produce " + num + " spread " + spread + " less than or equals to " + max);
            int[] nums = new int[num];
            int max2 = max - (num - 1) * spread - 1;
            // generate random offsets totally less than max2
            for (int j = 0; j < num; j++) {
                int next = RAND.nextInt(max2);
                // favour smaller numbers.
                if (max2 > spread/2)
                    next = RAND.nextInt(next+1);
                nums[j] = next;
                max2 -= next;
            // shuffle the offsets.
            for (int j = num; j > 1; j--) {
                swap(nums, j - 1, RAND.nextInt(j));
            // add the spread of 25 each.
            for (int j = 1; j < num; j++) {
                nums[j] += nums[j-1] + spread;
            return nums;
        private static void swap(int[] arr, int i, int j) {
            int tmp = arr;
    arr[i] = arr[j];
    arr[j] = tmp;
    public static String toString(int[] nums) {
    StringBuffer sb = new StringBuffer(nums.length * 4);
    sb.append("[ ");
    for (int j = 0; j < nums.length; j++) {
    if (j > 0) {
    sb.append(", ");
    sb.append(nums[j]);
    sb.append(" ]");
    return sb.toString();

  • How to get Numric value from a Char field in the database?

    I have the following values in a column in Database.
    COMP
    GRADE
    CANC
    CANCELLED
    Comp
    Complete
    INCOMP
    NC
    NS
    85%
    79
    88 .... etc....
    I have to take the value from this field if it is a Numeric other wise I have to ignore that value.
    Please let me know how to handle this?
    Thanks,
    Lakshmi

    Thanks for the inputs.
    Here I want to take the value if it is numeric else I
    will ignore that record.
    Please let me know how to validate the data for a
    Numeric value.
    I don't want to stop my program by throwing these
    exceptions.The sample code catches the exception. At that point you can do whatever you want (set a boolean to say the value is not a number, etc.) - the program does not stop.

  • The drop down list values want to vary based on the contents of another drop down field

    hi,
    hi in search page i have two drop down list. i have two tables and one mapping tables. service line and subservice line are tables and i have one mapping table. using rapid application i create one component using mapping table. now in search page i have two drop list. one is servline and another is sub serviceline. in service line i have values like 1,2 k  for subservice 3,4.5,6 for one service line ex. for 1 i have two subservice 3,4 and for 2 i have 5,6. now my requirment in if i choose service line 1 in first drop down list, automatically in second drop down list want to contain values 3, 4. before both the drop down list have values.if i chose one value the correponding mapping value want to come in drop down list in same context node.

    Hi,
    This requirement involves defining p-getter for the service type, and the v-getter of you sub type.
    Since this involves to populate the values of subtype attribute depending on value of service type, u need a round trip.
    This is done in the p-getter of the 1st attribute(service type in your case).
    In the v-getter of the 2nd attribute, 1st fetch the current value of attribute 1, then filter the value in the dropdown table according to ur logic.
    Ref :Drop down values in table view
    Regrads
    Anish

  • Trying to get a fourth field to populate based on the selection from three other dropdown menus.

    I would like the Treatment Classification field to populate with a combination of text and numbers based on my selection from three other drop down menus.
    For example:
    If I select "0-No Hurt" in the AHL field, "0-No Hurt in the PHL field, and "Near Miss in the Treatment Choice field, then the Treatment Classification field would populate to "L00NM".
    If I select "2-Moderate Hurt: in the AHL, "4-Fatality" in the PHL field, and "Restricted Work Incident" in the Treatment Choice field, then the Treatment Classifiaction field would populate to "L24RWI".
    If I select "1-Minor Hurt" in the AHL field, "4-Fatality" in the PHL field, and "Medical Treatment Incident" in the Treqatment Choice field, then the Treatment Classifiaction field would populate to "L14MTI".
    Etc, etc, etc.
    I could then fill in the resyt of the script with the required text.
    Not sure how to load my PDF file.
    Thanks,
    Rick

    Do your dropdown list items currently have export values set up? It seems like the value you want to construct is simply concatenating the values of the three dropdowns, and this would be easy if you set the export values of the list items appropriately. For example, the export value for the "0-No Hurt" item would be 0 and for "Near Miss" it would be "NM", etc., so the script could look something like:
    // Get the values of the drop downs, as strings
    var v1 = getField("AHL").valueAsString;
    var v2 = getField("PHL").valueAsString;
    var v3 = getField("Treatment Choices").valueAsString;
    // Set this field's value
    event.value = "L" + v1 + v2 + v3 + "other text goes here."

  • How to Get RGB Values from a CMYK Color in the DOM (CS5)

    (CS5, Actionscript)
    Hi all,
    I have an InDesign document containing TextFrames whose border colors are specified as a CMYK array.
    I would like to be able to get its color specification as its closest RGB equivalent.
    Does the InDesign DOM contain a method for doing this for me automatically?  If not, what workarounds are there?
    TIA,
    mlavie

    Here's how to convert RGB to CMYK:
    function rgb2CMYK (r,g,b){
        var color = app.documents[0].colors.add({space:ColorSpace.RGB,colorValue:[r,g,b]});
        color.space = ColorSpace.CMYK;
        var retVal = color.colorValue;
        color.remove();
        return retVal;
    The same idea for the reverse.
    For info on converting to grayscale, check out this:
    http://in-tools.com/article/scripts-blog/convert-colors-to-grayscal-in-indesign/
    HTH,
    Harbs

  • HT5622 I just got a new iPhone 5.  I am trying to get my apps from my iPhone 4 through the App Store I am receiving an error saying "ConnectionManager::invoke:: Failed to find service connection URL."  I am showing full strength  on my wifi signal.  What

    Help I keep getting a connection error for App Store and iTunes on my new iPhone 5 but not for game enter?  What should I do?

    From what I'm seeing, looks like it's being fixed even as we speak.  My recommendation is to wait an hour or so and check again.  Inconvenient, but that's probably the best option.

  • Query to display concatenated values from various records based on the keyn

    Dear all
    I have a table which has info like this
    keyno valueno
    20 1200
    21 1345
    20 1095
    20 9094
    21 3433
    22 5031
    21 199
    20 232
    the output has to be like this
    20 1200/1095/9094/232
    21 1345/3433/199
    22 5031
    is there any way to do this or do i have to get this done using an anonymous block
    i have intended to display this output as an LOV in oracle forms
    Kindly help me in this regard , iam just stuck
    With Warm Regards
    ssr

    Dear guys -- Jeneesh and Rob
    Thanks for the replies ,
    Jeneesh , I couldnt get this STRAGG ... i dont think it is a function provided by Oracle. So i couldnt make use of this
    and thanks Rob The SYS_CONNECT_BY_PATH seemed too confusing for my little brain rather i found out something simple
    wmsys.wm_concat which solved my reqmt ...
    I am yet to explore it and defenitly i have to work with this SYS_CONNECT_BY_PATH and then try with my reqmt ... as for now its solved

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

  • Get value from the array based on the HashCode

    public static void runJoin(int[][] t1,int[][] t2)
         PrintWriter out=null;
         int rows = 1000;
         int cols = 7;
         int [][] myTable3 = new int[rows][cols];
         int x = 0;
         System.out.print("Running HashJoin:Method loads the "+
         "smaller table in the memory and applies a hashing function "+
         "to common column and stores it in another table. "+
         "The larger table is then read from the file. "+
         "The same hashing function is applied to Col n of the table and a       matching record in the first table is looked up. A match will create a row in Table 3. ");          
    //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               }
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
                   while(e.hasMoreElements())
    //How do I get the value from the array based on the HashCode? Do I need to do a loop here???                         
    hashCodes1.get(e.nextElement());           
              }catch(Exception e){}

    ok I got it......
              //Apply hashing function to smaller table and store it in the memory.
              Integer[] It2 = new Integer[t2.length];
              int [] hashCodest2 = new int[t2.length];
              Hashtable ht = new Hashtable();
              for(int i =0; i <t2.length;i++){
                   It2[i] = new Integer(t2[0]);
                   hashCodest2[i] = It2[i].hashCode();
                   ht.put(new Integer(hashCodest2[i]),It2[i]);
              //Larger table get hashcodes and compare
              Integer It1[] = new Integer[t2.length];
              int [] hashCodest1 = new int[t2.length];          
              Hashtable ht2 = new Hashtable();
              for(int j =0; j <t1.length;j++){
                   It1[j] = new Integer(t1[j][4]);
                   hashCodest1[j] = It1[j].hashCode();               
                   ht2.put(new Integer(hashCodest1[j]),It1[j]);
              //Based on the hashcode get the value from the Table2;
              try{
    out = new PrintWriter( new FileOutputStream( "c:\\HashJoinTable.txt" ) );
              Enumeration e = ht.keys();
              Integer t3[] = new Integer[t2.length];
                   while(e.hasMoreElements())
                        t3[x] = (Integer) ht2.get(e.nextElement());                
                        x++;
              }catch(Exception e){}

  • Get array values from multidim array

    Hello Everyone,
    I am working with a two dim array. double twoDim[] = new double[100][100]. If I want to take "strips" of the array based on the x values I just do this.
    for(int i = 0; i < twoDim.length; i++)
         double a[] = twoDim;
    My question is how do I do a loop that returns a single dimensional array with respect to the y value ?  In effect doing this, (which fails miserably by the way).for(int i = 0; i < twoDim.length; i++)
    double a[] = twoDim[][i];
    Sincerely,
      Chem_E                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    That can't be done. The reason why it works so well with getting separate rows out of the 2d-array is that multi-dimensional arrays in Java are really just arrays of arrays.
    So each row is a separate array, which you can easily handle as a separate Object.
    You could wrap your 2d-array in a custom class (let's call it Matrix) and provide accessors that return views on the rows/columns (you could call them Vectors).

Maybe you are looking for