Loop through table's rows

Hi folks,
I have a table with multiple rows which each one of them contains one dropdown list.
In my code I want to loop through this table rows and check each dropdown list's selected-item.
How can I do this in code(JavaScript).
Thank you,
Yair

Check this thread,
it has solutions for JavaScript ind FormCalc.
http://forums.adobe.com/message/3345384#3345384

Similar Messages

  • How do I loop through tables, not columns in a table?

    Sorry if this is a long one. My problem is actually quite simple. I am trying to write either an ad hoc PL/SQL block or a stored procedure to loop 18 times (thru 18 tables) and perform a SQL query on those tables, returning 18 resultsets. I would like the results to show up on the screen (or in a spool file, whatever).
    So far I have tried 3 different approaches, none of which have worked.
    1. I tried to assign the select query to a variable (qry) and use EXECUTE IMMEDIATE qry. This forced me thru a variety of errors to declare variables and assign the result to them--EXECUTE IMMEDIATE qry into nm0, nm1, nm2...
    The problem with that was the resultset returned more than the variable was built for as there might be no rows returned, or it might be a thousand rows of data. So I tried changing the variables to VARRAYS, but it gave me a type mismatch as the underlying columns were NUMBER and VARCHAR2.
    DECLARE
         ctr number;
         TYPE NUMLIST IS VARRAY (1000) OF NUMBER;
         TYPE VARLIST IS VARRAY (1000) OF VARCHAR2(15);
         nm0 NUMLIST NOT NULL DEFAULT 1;
         nm1 VARLIST;
         nm2 NUMLIST NOT NULL DEFAULT 1;
         nm3 VARLIST;
         nm17 NUMLIST NOT NULL DEFAULT 1;
         qry VARCHAR2(2000) := 'klx_uln_p000_cells';
    BEGIN
    FOR ctr IN 1..17 LOOP
         IF ctr < 10 THEN
              qry := 'SELECT
              A.DIM_0_INDEX,
              S0.SYM_NAME,
              A.DIM_1_INDEX,
              S1.SYM_NAME,
              A.DIM_2_INDEX,
              S2.SYM_NAME,
              A.DIM_3_INDEX,
              S3.SYM_NAME,
              A.NUMERIC_VALUE,
              B.NUMERIC_VALUE
              FROM
              KHALIX.klx_uln_p00'||ctr||'_cells A,
              KHALIX.klx_ucn_p00'||ctr||'_cells B,
              KHALIX.KLX_MASTER_SYMBOL S0,
              KHALIX.KLX_MASTER_SYMBOL S1,
              KHALIX.KLX_MASTER_SYMBOL S7
              WHERE
              A.DIM_0_INDEX=B.DIM_0_INDEX AND
              A.DIM_1_INDEX=B.DIM_1_INDEX AND...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         ELSE
              qry := 'SELECT
              A.DIM_0_INDEX...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         END IF;
         BEGIN
         dbms_output.put_line('SELECT FOR KLX_ULN_P00'||ctr||'_CELLS');
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXECUTE IMMEDIATE qry into nm0,nm1,nm2,nm3,nm4,nm5,nm6,nm7,nm8,nm9,nm10,nm11,nm12,nm13,nm14,nm15,nm16,nm17;
    --     dbms_output.put_line(qry);
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   dbms_output.put_line('No data found for Query '||ctr);
         END;
    END LOOP;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
              dbms_output.put_line('No data found for Query '||ctr);
    END;
    2. So then I used REF CURSOR to create a stored procedure and return the values. That allowed me to run my query AND tokenize the tablenames with a counter so that it would loop through the different tables! However, I still could not get it to display the results without going to SQL Plus and typing 'print c;'.
    3. So, finally I tried to create a looping wrapper around the ref cursor to have some variable (ctr) increment so my query would get performed on table0_cells through table17_cells. This, too, did not work.
    If I manually go to SQL Plus and type:
    variable ctr number
    begin
    :ctr := 1;
    end;
    exec dupe_find(1,:c);
    it will execute for the first table (klx_uln_p001_cells) and I can then type 'print c' to see what was returned. But when I try putting this within a wrapper PL/SQL block with a Loop to make ctr go from 0 - 17 (to loop through table_names klx_uln_p000_cells to klx_uln_p017_cells), it does not work.
    Help! It should be very simple to loop through tables, shouldn't it? I just want a script that will loop through tables, perform a query on each table and display the results. For some reason, I can only find documentation examples on looping through columns that are all in the same table.
    Dave

    Here's a working example using your first strategy ...
    create table t1 (id number);
    create table t2 (id number);
    insert into t1 values (100);
    insert into t1 values (101);
    insert into t2 values (200);
    insert into t2 values (201);
    declare
    v_table_name user_tables.table_name%type;
    type ttab_id is table of t1.id%type index by binary_integer;
    tab_id ttab_id;
    begin
    for i in 1 .. 2 loop
    v_table_name := 't' || i;
    execute immediate 'select id from ' || v_table_name
    bulk collect into tab_id;
    dbms_output.put_line('query from ' || v_table_name);
    for j in 1 .. tab_id.count loop
    dbms_output.put_line(tab_id(j));
    end loop;
    end loop;
    end;
    There are many other ways to do this (especially if you need to do more than just print out the data).
    Richard

  • How to loop through a single row of data?

    What I'm trying to do is use a cursor to loop through a clob. When I create my cursor I get the an error telling me that the table does not exist. Which implies that I have an implicit cursor. Is there a way to get around this?

    > How to loop through a single row of data?
    By not looping as there is only a single row?
    > What I'm trying to do is use a cursor to loop through a clob
    Processing (looping through) a CLOB has nothing to do with a cursor.
    > When I create my cursor I get the an error telling me that the table does
    not exist. Which implies that I have an implicit cursor.
    Incorrect. It simply means that
    a) you do not have permissions to access that table from within the current context
    b) it does not exist (e.g. you have misspelled the object name, you have not qualified it properly within the current scope, etc)

  • Loop through table (beginner question)

    Hello,
    I been reading and reading but can´t seem to do what I want to do.
    I do a lot of forms in Livecycle but can´t seem to understand even the most easy loop.
    Lets say I have a table with two columns and ten rows. Textfields in column A is called Cell1 and in column B Cell2.
    I want to look through all the rows for this:
    If(Cell1.rawValue !== null)
    Cell2.fontColor = "255,0,0";
    else
    Cell2.fontColor = "0,0,0";
    If anyone can help me with this I would be very happy. Mayvbe I can start to understand this since it seems like I´m missing out on some very handy functions,.
    / Anders
    Sweden

    Thank you so much
    And if I would like to limit the loop I write as follows?
    for (var a=0;a<10;a++){    
      if (Row.item(a).Cell1.rawValue!==null)       
        Row.item(a).Cell2.fontColor = "255,0,0";    
      else          
    Row.item(a).Cell2.fontColor = "0,0,0"; }
    Thanks again.
    / Anders
    Sweden

  • Loop through table(table is created dynamically)

    Hi all,
    I have a table that is created dynamically.It has got 3 columns and 8 rows.In first row - first column,I have a value that is set dynamically.Now, How can I loop through this table and get this value?
    The table context node and value attributes are also created dynamically.
    Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
    TimesheetData
    col1.Value
    col2.Value
    col3.Value
    Again.... this node and attributes are not there in my view context by default, its getting created and binded dynamically here.
    Thanks Kukku

    Hi,
    Following is the code to iterate through the elements
    //Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
    for(int x=0;x<wdContext.getChildNode("TimesheetData",0).size(); x++)
                IWDNodeElement nodeElement = wdContext.nodeTimesheetData().getElementAt(x);
                String value1 = (String) nodeElement.getAttributeValue("col1");
                String value2 = (String) nodeElement.getAttributeValue("col2");
                String value3 = (String) nodeElement.getAttributeValue("col3");
    Regards
    Ayyapparaj

  • Question about Looping through tables in Adobe Form

    Hello,
    We have an adobe form which is to be filled offline. It consists of a table. Table can have repeating rows and user can add\remove rows as they wish.  The cardinality of the context node where we need to bind this table data is set to 1…n
    We want to know the process to get all the values in the table back into our context node once the form is uploaded. I assume we need to loop through the table, and add elements to the context node.  Can someone please let us know if we’re on the right track, and provide some sample code if possible?
    <b>We can’t figure out a way to loop through a table inside an Adobe form.</b>
    We are using Web Dynpro Java with Adobe Livecycle Designer 7.1
    Your help is much appreciated.
    Thanks,
    Rob.

    Try using...
    for (z = 0; z < 16; z++) {
         this["cb"+z].setStyle("styleName", "cssCBstyle");
    That is the way to target them.  I haven't dealt with setting styles, so I can't answer for that aspect working or not.

  • Looping through table in ADOBE TABLE...HOW?

    Hi,
    I'm having a problem with writing scripts on looping through a dynamic table in adobe and disabling certain cell in the table.
    can some one write me the script to help me out...please.... here is my email add. [email protected]
    Regards,
    Vinod

    Hi Denise
    You can use tableView for this which is available in htmlb.
    There is a attribute in tableView called visibleRowCount.
    The integer value that u give for this attribute , only that number of rows will be visible on your BSP page.
    This is the sample code :
          <htmlb:tableView id              = "tb1"
                           headerText      = "Communication"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "4"
                           fillUpEmptyRows = "true"
                           table           = "<%= itab %>" >
                    <htmlb:tableViewColumn
                     columnName     = "CURRENT_STATE"
                     title          = "CURRENT STATE"
                     edit           = "TRUE" />
    .                     </htmlb:tableView>
    Here tableview id  and table is mandotory field.
    Give as many tableViewColumn as u have column in your internal table ( Here CURRENT_STATE is the name of the Column that I have in my internal table).
    Here visibleRowCount is 5, so only 5 rows will be visible at a time .For other entries u have to click on
    my click handler which is like a footer in a tableView, and next 5 entries will become visible and like that.
    Before implementing this, fill your internal table
    in OnCreate in Flow logic ( in do_init in case of MVC).

  • Loop through tables based on data dict values

    Hi,
    I working on an old v7.3.4 database that I'm not familiar with and I want to loop through the tables and count the occurrence of a field value based on table names i've retrieved from the data dictionary. None of the tables have relational keys defined.
    In a cursor I can loop thru all_tab_columns and load variables with the table, column names, and the datatype, but then I want to use these values in a second nested cursor to loop through each table found by the first cursor.
    When I do :
    Select var_colname from var_tabname
    i get
    The following error has occurred:
    ORA-06550: line 23, column 10:
    PLS-00356: 'V_TABNAME' must name a table to which the user has access
    ORA-06550: line 22, column 5:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 22, column 12:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 27, column 7:
    PL/SQL: SQL Statement ignored
    so it would seem I can't use a variable to substitute the table name in the 'from' clause. Does anyone know of a way round this ?
    Thanks in advance

    Hi,
    You will have to use dynamic sql to create your second cursor.
    DECLARE
         v_sql_query VARCHAR2(400);
         TYPE cur_typ IS REF CURSOR;
         c1 cur_typ;
         mYRec MyTable%rowtype;
    BEGIN
         v_sql_query := 'select * from MyTable';
         OPEN c1 FOR v_sql_query;
              LOOP
              FETCH c1 INTO mYRec;
                   EXIT WHEN c1%NOTFOUND;
                   EXIT WHEN c1%NOTFOUND IS NULL;
    /*processing here*/
              END LOOP;
         CLOSE c1;
    END;
    Regards

  • Loop through table in XI

    Hi Guys,
    I have scenario where i call a BAPI and get return parameter as a table. I want to loop through this table in XI/BPM. Can i get some help on how to loop thorugh table in XI?

    Hi yashpal,
    Bloack Step in a BPM is used to process a sequence of steps repeatedly  for different information.
    The block step can be processed using FOR EACH and PAR FOR EACH. For each will process the info one after the other and PAR FOR EACH will do it in parallel.
    For more info on the Block Step Type in particular and the BPM in XI , check these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/f6/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
    Hope this helps,
    Regards,
    Bhavesh

  • How to loop through classic report rows?

    Hi,
    I have a page that has a classic report region. Can I somehow loop through the rows in the report result?
    If I put a checkbox item in the query then using this works fine, but I would not like to add checkbox I just would like to loop through the records.
    FOR I in 1..APEX_APPLICATION.G_F02.COUNT LOOP
    Do something with record having  checkbox item value APEX_APPLICATION.G_F02(i);
    END LOOP;
    TIA,
    Tamas

    Andy,
    What I would like to do is to let the user click a report row, then navigate to a detail form page and display detailed information of the given report row. And should the suer decide to have a look at all the records, then let him/her click a next button on the detail form and display the next row in the report result on the detail form.
    Thanks for the tip. if there is no other way, I will probably do this way.
    Tamas

  • Loop through values in rows to find faulty data

    Hi all,
    We have a column which is supposed to have values in increasing order.(If it doesn't comply with this rule, we want to discard the row). How do I loop through rows for a particular column, in SQL or PL.SQL?
    Thanks.

    user12295995 wrote:
    If it doesn't comply with this rule, we want to discard the rowNot sure what you mean. It looks like you want to get rid of duplicates. If so, use:
    DELETE tbl WHERE ROWID NOT IN (SELECTMIN(ROWID) FROM tbl GROUP BY col)
    /If you want to identify gaps, use:
    with t as (
               select 1 id from dual union all
               select 2 id from dual union all
               select 3 id from dual union all
               select 4 id from dual union all
               select 5 id from dual union all
               select 11 id from dual union all
               select 12 id from dual union all
               select 13 id from dual union all
               select 21 id from dual union all
               select 22 id from dual union all
               select 23 id from dual
    select  '[' || (prev_id + 1) || ' - ' || (id - 1) || ']' gap
      from  (
             select  id,
                     lag(id) over(order by id) prev_id
               from  t
      where id > prev_id + 1
      order by id
    GAP
    [6 - 10]
    [14 - 20]
    SQL> SY.

  • Loop through table

    is it possible to loop through the xml table in the report?
    i use xml as datasource. can i create my own function to find the specified value i need.
    how to create sql expression in cr4e?
    thanks,

    Note that SQL and XML are incompatible considerations.
    You sound as if you're looking for data pre-/post- processing, which CR4E is not designed to do.  It'll filter data, link disparate recordsets, but looping across XML isn't something it's specifically designed to do.
    If you can give some indication of what your ultimate task is, then there may be more options.
    Sincerely,
    Ted Ueda

  • Loop through a csv file and return the number of rows in it?

    What would be simplest way to loop through a csv file and
    return the number of rows in it?
    <cffile action="read" file="#filename#" output="#csvstr#"
    >
    <LOOP THROUGH AND COUNT ROWS>

    ListLen(). Use chr(13) as your delimiter

  • How Do I get SSIS To Stop Looping Through Excel Rows After Last Populated Record?

    I have a package that loops through many excel files. Each Excel File has about 5000 rows. My problem is that after the 5000th row SSIS keeps looping through all the rows after the last row. There are nothing in these rows. This is a complete bottleneck
    of my package because it takes forever when doing this. How do I stop this?
    Thanks

    Another way is to specify the range in select statement which can be done in two ways
    http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
    http://sqlserversolutions.blogspot.in/2009/02/selecting-excel-range-in-ssis.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Looping through row selector exonentially duplicating

    Using Apex 4.2
    Background
    Created a Tabular Form based on a view. Removed all the default multi-row updates and deletions, buttons and processes.
    I am using a tabular form because of the fact that I can gain access to a row selector.
    The row data itself is all read only so in effect this is a report with a row selector.
    This is because I can't find a way to select a row an interactive report, well I can and did but this was a work around.
    Problem
    I have created a button to process the selector to run the below code:
    begin
    kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f01(1)) ;
    kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'Selected Check Boxes:'||wwv_flow.g_f02(1)) ;
       for i in 1..wwv_flow.g_f01.count
       loop
       kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'i:'||i) ;
          kdm_adm_utils.log ('Page', 'XKDM: WF: Current Development', 'WF ID:'|| wwv_flow.g_f02 (wwv_flow.g_f01.count)) ;
       end loop;
    end;
    I just wanted to see what would be output. For one row this works fantastically and I can find the ID based on the row
    When I select more than one row the loop run's through for the number of rows but then also runs for the number of rows selected.
    So if I selected threee rows this above procedure would run three times, each times looping three times.
    I have set the execution scope to: For Created and Modified Rows in the button condition that appears.
    Required
    I only want to loop through the selected rows once per button click
    OR
    Know which row I am currently looping through.
    Really would appreciate some kind of input here.

    I think the built in selector is making your life harder because the information that contains is 1,2,3,4,5.  You then need to map 3 to the ID of your 3rd row.
    So, if you check row 1 and 3, on submit, the row selector will have two rows, one with value of 1 and with with value of 3.
    I would remove the selector, use and ID column that I can change to be Simple Checkbox (or whatever value you can use to uniquely identify it).  Or add your own apex_item.checkbox(n, ID) to your SQL.
    Then your loop on apex_application.g_f01.count (if that's the checkbox column) will only contain the elements checked and their values will be the ID that are checked.
    All that said, here's a useful example from Denes Kubicek
    http://apex.oracle.com/pls/otn/f?p=31517:95
    Hope this makes sense
    Thanks
    -Jorge
    http://rimblas.com/blog/
    Message was edited by: jrimblas
    Added link to Denes example page

Maybe you are looking for

  • Error while opening a function

    HI, 1. Create a query-only version of the System Profile Options function-- fun name is view system profile 2. and i assigned his to one of existing menu ABC Am able to see the this under the menu ABC.. but wen i click that it throws error The View S

  • Find a number in a string

    Hi all, I've got a text field in my source table that can contain both numbers and characters, like any normal varchar2. The issue is with a field that should contain insurance numbers, but also thinks "hello world" will do! A change to the applicati

  • Can I use the same apple ID for my personal and work phones?

    I have a personal iPhone (AT&T) and am getting one issued through work (Verizon). Am I able to use the same Apple ID for both phones?

  • Is Zen Micro display customisable? (No album inf

    Hi! I ordered a Zen Micro and I've set all my ID3 tags and create some playlists in WMP0. I have one big possible problem : All my MP3 have ID3 Tag (Artist - Title) info. but half of them don't have Album information. Can you set up the display so th

  • Nokia x7 issue

    hi, recently purchased a x7. But i have issues on touch screen. Some options are not sensable for touch. Pls help.