Problem looping through recordset

Hi,
I am having a problem with the following code. In the test case, the recordset returns more than one record. Only one record is inserted, and the loop aborted after the insert. If I take out the insert statement the loop cycles through for every record. I do not believe there is anything wrong with the insert statement, as the first record is inserted. Any help would be appreciated.
  while(rs.next()){
                 System.out.println("test");
                 String equip = rs.getString("EQUIP");
                 String pm = rs.getString("PM");
                 String lim = rs.getString("LIMIT");
                 String item_val = rs.getString("ITEM_VALUE");
                 String source = rs.getString("SOURCE");
                 myStatement.executeQuery("INSERT INTO TESTTBL(ACTION,STATUS,TOOL,REMARK) VALUES('STACK VALIDATION','UPDATED', '" + equip + "','LIMIT: " + lim + " - VALUE: " + item_val + " SOURCE: " + source + "')");
                 System.out.println("INSERT INTO TESTTBL(ACTION,STATUS,TOOL,REMARK) VALUES('STACK VALIDATION','UPDATED', '" + equip + "','LIMIT: " + lim + " - VALUE: " + item_val + " SOURCE: " + source + "')");
             }

Did rs come from myStatement?
From http://java.sun.com/j2se/1.4.2/docs/api/java/sql/ResultSet.html :
A ResultSet object is automatically closed when the Statement object that generated it is closed, re-executed, or used to retrieve the next result from a sequence of multiple results.
You have to use two different statements: one for the rs that you're looping through and one for the insert that occurs while still using the first rs.

Similar Messages

  • Looping through DOM nodes ....

    Hi,
    I am having a problem looping through the DOM tree and inserting the nodes into my table correctly.
    here is the basic structure of my XML file:
    <root>
    <row>
    <user>
    <db>
    <data>A</data>
    <data>B</data>
    </db>
    </user>
    <user>
    <db>
    <data>A</data>
    <data>B</data>
    <data>C</data>
    </db>
    </user>
    </row>
    </root>
    now, I need to put the text in the data-tag into a table, but since I dont know how many elements there are how in the world would one be able to insert the correct amount? Is there an Xpath-function that can count the nodes for me? I need some assistance or examples on PLSQL code for this please. I have so far just gone through with a for-loop with a delimiter=xmldom.getLength(mynodes) but that only measures the very first users data-tag, and that leaves the rest kinda in a lotto situation if the db-elements below have more or less data-elements than the first one. In addition its inserted a blank in the field in the table(not good).....
    thanks for any help or assistance,
    Sven

    Hi,
    I am having a problem looping through the DOM tree and inserting the nodes into my table correctly.
    here is the basic structure of my XML file:
    <root>
    <row>
    <user>
    <db>
    <data>A</data>
    <data>B</data>
    </db>
    </user>
    <user>
    <db>
    <data>A</data>
    <data>B</data>
    <data>C</data>
    </db>
    </user>
    </row>
    </root>
    now, I need to put the text in the data-tag into a table, but since I dont know how many elements there are how in the world would one be able to insert the correct amount? Is there an Xpath-function that can count the nodes for me? I need some assistance or examples on PLSQL code for this please. I have so far just gone through with a for-loop with a delimiter=xmldom.getLength(mynodes) but that only measures the very first users data-tag, and that leaves the rest kinda in a lotto situation if the db-elements below have more or less data-elements than the first one. In addition its inserted a blank in the field in the table(not good).....
    thanks for any help or assistance,
    Sven

  • How do I Loop through a recordset using PHP

    I have a recordset containing a MySql table with 5 columns, each one containing an email address of an official in a club.
    Each row represents a different club, and each column a different type of official.
    The first column represents chairmen, the next treasurers etc...
    The recordset is called $mailset.
    I need to loop through each row of $mailset and extract the email addresses of each column and concatenate them into a string seperated by semi colons ; so it ends up like this:
    [email protected];[email protected];[email protected]; and so on.
    This is how the recordset is set up:
    mysql_select_db($database_dummyread, $dummyread);
    $query_mailset = "SELECT club_chair_email, club_treas_email, club_sec_email, club_delegate_email, club_deputy_email FROM clubs";
    $mailset = mysql_query($query_mailset, $dummyread) or die(mysql_error());
    $row_mailset = mysql_fetch_assoc($mailset);
    $totalRows_mailset = mysql_num_rows($mailset);
    ?>
    I tried using a  loop to step through the recordset, but it always shows the first record, so its not moving the pointer through the file.
    The pseudo code aught to be something like this:
    Initialise variables and move to the first record
    If there are records to process
                   Read a record
                        Process all columns
                Move on to the next record
    else
         if there are no records
              print an error message
    else
    Print the results.
    Can anyone give me a hint as to how to move from row to row in a recordeset under the control of a loop.
    I am using PHP and MySql. (as far as I know, it is the original - not PDO or MySqli)

    Each call to mysql_fetch_assoc($mailset) retrieves the value at the current location and increments the pointer in the recordset array. So use either a do or while loop and call mysql_fetch_assoc($mailset) from within the loop.
    From the docs:
    Returns an associative array that corresponds to the fetched row and moves the internal data pointer ahead. mysql_fetch_assoc() is equivalent to calling mysql_fetch_array() with MYSQL_ASSOC for the optional second parameter. It only returns an associative array.

  • Problem when loop through a list within CollectionModel

    In my bean, I have these codes to define a node.
    Map<String, Object> node = new HashMap<String, Object>();
    node.put("Nodeid", nodeid);
    List theColors = new ArrayList();
    node.put("Colors", colors);
    node.put("Type", type);
    node.put("Desc", desc);
    Then, a list of these nodes are converted to CollectionModel using ModelUtils.toCollectionModel(nodes);
    In my jspx, I am able to loop through nodes, and get Type, Nodeid and Desc from the node to show on the screen.
    I am trying to loop through the list of colors within the node to draw circles with different diameter.
    <af:forEach var="theColor" items="#{node.Colors}" varStatus="vs">
    <dvt:pointLocation pointX="50%" pointY="50%">
    <dvt:marker id="mk2" scaleX="#{15-vs.index*2}" scaleY="#{15-vs.index*2}" shape="circle" fillColor="#{theColor}" />
    </dvt:pointLocation>
    </af:forEach>
    But above code does not work.
    Can someone help me? Any suggestions?
    Thanks.

    I want to call a javascript function inside a c:forEach loop.Nope sorry, won't work.
    Java/JSP runs on the server. At the server end, any html/script code is just template text to output to an html file.
    The server produces an html file, and sends it to the client.
    Java stops running.
    Java cannot call javascript, javascript can not call java. There is no direct communication.
    Java code can produce javascript code to run on a page.
    The only communication javascript has back with the server is if it makes a request (click a link, submit a button, Ajax call...)

  • Problem while looping through record set and tem table for matching data

    hi I am using one record set and ane temp table and looping through both to find the match between dates.
    If date matches then it shud do some processing otherwise it will return default values(null values).
    FOR i IN student_rec .FIRST..student_rec .LAST          /*student_rec.school_date has 01-MAR-2012,02-MAR-2012,03-MAR-2012,04-MAR-2012,05-MAR-2012*/
    LOOP
    l_return_out.school_date := student_rec(i).school_date;
    l_return_out.marks_obtained := student_rec(i).marks_obtained;
    FOR i IN selected_dates .FIRST..selected_dates .LAST          /*selected_dates has 02-MAR-2012,03-MAR-2012,05-MAR-2012*/
    LOOP
    DBMS_OUTPUT.PUT_LINE(selected_dates(i));
    IF selected_dates(i)=student_rec(i).sett_date
    THEN
    EXIT;
    end if;
         ---------call procedure P1
    -----------get output as ret_val1               /*getting ret_val1 as 10 for 02-MAR-2012,03-MAR-2012,05-MAR-2012 */
         ----------call procedure P2
    ---------get ouput as ret_val2               /*getting ret_val1 as 20 for 02-MAR-2012,03-MAR-2012,05-MAR-2012 */
    if ret_val1>0 0r ret_val2>0
    then
    l_return_out.has_csts := yes;
    l_return_out.cst_present := 10;
    l_return_out.cst_absent := 20;
    else
    l_return_out.has_csts :=No;
    l_return_out.cst_present:= 0;
    l_return_out.cst_absent := 0;
    end if;
    end loop;
    l_return_out.has_cst := student_rec(i).has_csts;
    l_return_out.cst_missing := student_rec(i).cst_present;
    l_return_out.cst_existing := student_rec(i).cst_absent;
    PIPE ROW(l_return_out);
    END LOOP;
    RETURN ;
    I am expecting this as result
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          yes 10          20
    03-MAR-2012     40           yes 10          20
    04-MAR-2012     70          
    05-MAR-2012     60          yes 10          20
    but this as result
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          
    03-MAR-2012     40           
    04-MAR-2012     70          
    05-MAR-2012     60          
    Can anybody please highlight the mistake i am doing while processing the logic??
    Edited by: 942390 on Jul 13, 2012 8:44 PM
    Edited by: 942390 on Jul 13, 2012 8:45 PM

    I am getting a set values from a record set....student_rec
    and on pipelining this record set from 1st till last
    i am getting this
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          
    03-MAR-2012     40           
    04-MAR-2012     70          
    05-MAR-2012     60     
    so initially has_csts, cst_present and cst_absent is null for all dates.
    now have a temp table of selected_dates(which contains these dates 02-MAR-2012,03-MAR-2012,05-MAR-2012)
    now I am want to populate has_csts, cst_present and cst_absent with data only for those dates which is present in selected_dates temp table(02-MAR-2012,03-MAR-2012,05-MAR-2012) and that too has_csts, cst_present and cst_absent will be populated with some condition (based on the values from procedure got from P1 and P2).
    so want result set to look like
    school_date     marks_obtained     has_csts     cst_present cst_absent
    01-MAR-2012     20          
    02-MAR-2012     30          yes 10          20
    03-MAR-2012     40           yes 10          20
    04-MAR-2012     70          
    05-MAR-2012     60          yes 10          20
    so what could be the possible solution to obtained this....

  • Help with Trigger - looping through SELECT results

    How do I loop through a SELECT query within a Custom Trigger? I can
    execute the query fine, but the PHP mysql_xxx_xxx() functions don't
    appear to work inside a custom trigger. For example:
    This ends up empty:
    $totalRows_rsRecordset = mysql_num_rows($rsRecordset);
    While this returns the correct # of records:
    $totalRows_rsRecordset = $rsRecordset->recordCount();
    I need to loop through the records like I would with
    mysql_fetch_assoc(), but those mysql_xxx_xxx() don't seem to work.
    This works great outside a custom trigger, but fails inside a custom
    trigger:
    do {
    array_push($myArray,$row_Recordset['id_usr']);
    while ($row_Recordset= mysql_fetch_assoc($Recordset));
    What am I missing?
    Alec
    Adobe Community Expert

    Although the create trigger documentation does use the word "must", you are quite free to let the trigger fire during a refresh of the materialized view. Generally, you don't want the trigger to fire during a materialized view refresh-- in a multi-master replication environment, for example, you can easily end up with a situation where a change made in A gets replicated to B, the change fired by the trigger in B gets replicated back to A, the change made by the trigger in A gets replicated back to B, in an infinite loop that quickly brings both systems to their knees. But there is nothing that prevents you from letting it run assuming you are confident that you're not going to create any problems for yourself.
    You do need to be aware, however, that there is no guarantee that your trigger will fire only for new rows. For example, it is very likely that at some point in the future, you'll need to do a full refresh of the materialized view in which case all the rows will be deleted and re-inserted (thus causing your trigger to fire for every row). And if your materialized view does anything other than a simple "SELECT * FROM table@db_link", it is possible that an incremental refresh will update a row that actually didn't change because Oracle couldn't guarantee that the row would be unchanged.
    Justin

  • 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 &lt; 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

  • Looping through each record

    Hi everyone
              I am new in crystal reporting and using Crystal Reports XI release 2. Firstly I should explain what I need to have. In my database I have got a parent table called Initiatives and a child table called benefits. One initiative has got many benefits associated with it and benefits are updated regularly by the users. Now my manager wants me to create an Initiative reports in such a way that all the initiatives are displayed and against each initiative there should be a box filled with either of these colour (red, yellow, green).
    Let's say if Initiative "X" has got 10 benefits and if one or more benefits are outstanding by more than 2% then the colour of the box should be red. And if no benefit is outstanding by more than 2% and one or more benefits are outstanding more then 1% and less then 2% then colour of box should be yellow. And if no benefit is outstanding more than 1% then colour of box should be green.
    Now for this I have created a report displaying all initiatives and a sub report with a SQL command containing the data from the benefits table. I have also included a database field which I would use as a box.
    Now I want to loop through each record of the crystal report till the last record and format the field as per condition. I would probably use nested loop to look for the status of the benefits but I don't know how to do this in CR. In short I am looking to do this thing in CR
    While Recordset.EOF
    Do
    But I can't find a key word for EOF or count-1 or some thing like that.
    Seeking the help of you guys.
    Regards,

    It would be much easier to simply let Crystal's conditional formatting do this for you.
    Almost every formatting aspect of each object in Crystal can be controlled via expressions.  Just click on the expression button to the right of the property...
    ido

  • Looping through SQL statements in shell script

    Hello members,
    I'm working on the Solaris environment and the DB i'm using is Oracle 10g. Skeleton of what I'm attempting;
    Write a ksh script to perform the following. I have no idea how to include my sql query within a shell script and loop through the statements. Have therefore given a jist of what I'm attempting, below.
    1. Copy file to be processed (one file at a time, from a list of 10 files in the folder ).
    for i in *
               do
               cp $i /home/temp[/CODE]2 . Create a snapshot(n) table : Initialize n = 1 -- -- To create my snapshot table and inserts records in SQL
    create table test insert account_no, balance from records_all;3. Checking if the table has been created successfully:
    select count(*) from snapshot1 -- query out the number of records in the table -- always fixed, say at 400000
    if( select count(*) from snapshot(n) = 400000 )
    echo " table creation successful.. proceed to the next step "
    else
    echo " problem creating table, exiting the script .. "  4. If table creation is successful,
    echo " select max(value) from results_all " -- printing the max value to console
    5. Process my files using the following jobs:
    ./runscript.ksh - READ -i $m ( m - initial value 001 )
    ./runscript.ksh - WRITE -i $m ( m - initial value 001 -- same as READ process_id )
    -- increment m by 1
    6. Wait for success log
    tail -f log($m)* | -egrep "^SUCCESS"7. looping to step1 to :
    Copy file 2 to temp folder;
    create snapshot(n+1) table
    Exit when all the files have been copied for processing.
    done -- End of Step 1
    Pointers on getting me moving will be very valuable.
    thanks,
    Kris

    Hi,
    Are you inserting the data from file or from some table.
    If it is from file, I suggest sql loader would be better, I suppose.
    If it is from table, then something like this
    for i in *
               do
    sqlplus username/password@db_name<<EOF
                create table test select * account_no, balance from records_all;
    EOF
    exit
    doneAnurag

  • How to loop through CSV file

    Hi,
    I want to loop through each column of a CSV file.
    And while looping each column, I want to loop each row
    starting with the 2st row.
    I wrote the code as below, but it is looping through the rows
    starting from row 1.
    How do I make it start the loop as from row 2 in the CSV ?
    (see code below)
    Can someone tell me how to do this?
    Thx
    <!--- get and read the CSV-TXT file --->
    <cffile action="read" file="C:\Documents and
    Settings\user\Desktop\EM-CSV\test.csv" variable="csvfile">
    <!--- loop through the CSV-TXT file on line breaks and
    insert into database --->
    <table border="1">
    <cfloop index="index" list="#csvfile#"
    delimiters="#chr(10)##chr(13)#">
    <!--- <cfoutput>#listgetAt('#index#',1,
    ',')#</cfoutput><br> --->
    <tr>
    <td><cfoutput>#index#</cfoutput></td>
    <td><cfoutput>#listgetAt('#index#',2,
    ',')#</cfoutput></td>
    <td><cfoutput>#listgetAt('#index#',3,
    ',')#</cfoutput></td>
    </tr>
    </cfloop>
    </table>

    Hello, your code works perfectly.
    Now I am having a slight problem with it.
    I have added the code to check whether a particular cell of
    the CSV is blank. (see code below)
    But it is giving me error message.
    Can you please tell me what am doing wrong?
    Thx
    <!--- loop through the CSV-TXT file on line breaks and
    insert into database --->
    <cfset isRowTwoOrLater=false>
    <table border="1">
    <cfloop index="row" list="#csvfile#"
    delimiters="#chr(10)##chr(13)#">
    <cfif isRowTwoOrLater>
    <tr>
    <cfif #listgetAt(row,1, ',')# neq ''> <!--- I HAVE
    ADDED THIS PART TO CHECK WHETHER IT IS BLANK --->
    <td><cfoutput>#listgetAt(row,1,
    ',')#</cfoutput></td>
    <cfelse>
    <td><cfoutput>It is
    blank</cfoutput></td>
    </cfif>
    <td><cfoutput>#listgetAt(row,2,
    ',')#</cfoutput></td>
    <td><cfoutput>#listgetAt(row,3,
    ',')#</cfoutput></td>
    </tr>
    <cfelse>
    <cfset isRowTwoOrLater = true>
    </cfif>
    </cfloop>
    </table>

  • Looping through Multiline list in Workflow

    We have a Workflow that sends an email with an Office document (ie., Excel) as an attachment to each Executing Service Engineer on service items that are relevant for planning. In an attempt to do that we loop through a multiline list, which is used to hold the relevant service items for processing.
    1.     We created an activity step Initialize work items count to store the number of service work items, e.g. Work_items_count
    2.     We use a loop step (loop until) to keep looping while work_items_count has a value greater than zero.
    3.     Within the loop, we use another activity step Get install item ibase components that processes the first item of the multiline container element Work_items and returns the ibase components for the Executing Service Engineer. After processing has completed, we delete the item from Work_items and decrement the counter work_items_count by 1.
    4.     As part of the final steps in the loop, an Excel document is created from a template using a standard object method WF_DOC-CREATE. The document is than converted to an SOFM object using standard object method WF_DOC-CREATE_SOFM, and than an email is generated with the SOFM object as an attachment using standard object method SELFITEM-SENDTASKDESCRIPTION.
    The problem that’s occurring is that on the second loop pass, the status for activity step Get install item ibase components is set to ready expecting user intervention. I know that it’s a dialogue step, but why than does it execute seamlessly on the first loop pass? I’ve set the agent assignment on the Workflow and on the task to General task so that anybody can execute it so I don’t think it’s an agent assignment problem.
    Does anyone have any suggestions? Do i need to use dynamice parallel processing in this case?

    We have a Workflow that sends an email with an Office document (ie., Excel) as an attachment to each Executing Service Engineer on service items that are relevant for planning. In an attempt to do that we loop through a multiline list, which is used to hold the relevant service items for processing.
    1.     We created an activity step Initialize work items count to store the number of service work items, e.g. Work_items_count
    2.     We use a loop step (loop until) to keep looping while work_items_count has a value greater than zero.
    3.     Within the loop, we use another activity step Get install item ibase components that processes the first item of the multiline container element Work_items and returns the ibase components for the Executing Service Engineer. After processing has completed, we delete the item from Work_items and decrement the counter work_items_count by 1.
    4.     As part of the final steps in the loop, an Excel document is created from a template using a standard object method WF_DOC-CREATE. The document is than converted to an SOFM object using standard object method WF_DOC-CREATE_SOFM, and than an email is generated with the SOFM object as an attachment using standard object method SELFITEM-SENDTASKDESCRIPTION.
    The problem that’s occurring is that on the second loop pass, the status for activity step Get install item ibase components is set to ready expecting user intervention. I know that it’s a dialogue step, but why than does it execute seamlessly on the first loop pass? I’ve set the agent assignment on the Workflow and on the task to General task so that anybody can execute it so I don’t think it’s an agent assignment problem.
    Does anyone have any suggestions? Do i need to use dynamice parallel processing in this case?

  • 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

  • Loop through sub-directories

    Hi,
    I want to loop through the sub-directories of one given folder. How to correct the following problems?
    dir = args[0];
    try
    string [] dirlvl2Ent = Directory.GetDirectories(dir);
    for (string dirlvl2 in dirlvl2Ent)
    Error 1 ; expected F:\App8\Program.cs 50 37 ProcessSWFile
    Error 2 ; expected F:\App8\Program.cs 50 40 ProcessSWFile
    Error 3 Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement F:\App8\Program.cs 50 40 ProcessSWFile
    Many Thanks & Best Regards, Hua Min

    for should be foreach.
    string [] dirlvl2Ent = Directory.GetDirectories(dir);
    foreach(string dirlvl2 in dirlvl2Ent)
    jdweng

  • Looping through results of a Select through a DB adapter

    I am selecting an unknown number of rows from a database through the DB adapter into my process. When I get these results I need to loop through them, but the examples I have seen require an attribute to define each row for the loop to work . My result set is not giving me an attribute and I do not see how to define one in the wizard used to define the adapter.
    Is there a way to assign an attribute to each row automatically as it comes out or after the fact? Or is there another way to attack this problem that I do not see?
    Thank you in advance for the help.
    --Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    you can take the results payload and loop thru with the while statement, then you can iterate thru each result and doing whatever you need to. Just make a counter variable of type int and count the number of records in the payload, then initialize a iterator varible on int and set to 0.
    then just loops thru the payload and add +1 to iterator until it reaches the count number. This allows you to hit each records one by one, and do any kind of analysis on the current record set.

  • Question on how to loop through a variable amount of objects

    I have a csv file which I am parsing with powershell and it works perfectly. I would like to speed it up. Currently, I call a line that is customized for each groups list of subnets.
    I have about 30 groups.
    Some groups have one subnet, some have 5 subnets.
    I want to set up some sort of loop to parse everything while executing a single Import-CSV. Currently I call Import-CSV once per group. It takes me about 2-4 minutes to parse the entire file depending on the speed of the machine.
    The csv file has about 30,000 rows. I am not concerned about running out of resources. This is as much a learning challenge as a desire to make better powershell scripts.
    Below is a portion of the one liner that would parse the entire csv file looking only for those items that match, and writing them out to that groups specific csv file.
    Example #1
    Import-Csv $HostList |  Where-Object {$_."IP Address" -Match "^192.1.*" -or $_."IP Address" -Match "^192.2.*" -or $_."IP Address" `-Match "^192.3.*"  .....}| do more stuff...
    Example #2
    Import-Csv $HostList |  Where-Object {$_."IP Address" -Match "^192.7.*" ....}| do more stuff...
    The example above is just a snippet from code that works perfectly.
    The problem I am asking for help with is, when I loop through the items I am matching against (subnets), if one group has 3 items to match against, another has 1, another has 7, how do I set up such a loop?
    Am I using some sort of 'while'  $_."IP Address" or...?
    Do I create a big 30,000 array (Does PS even use arrays?)
    I would love to know what this type of looping is called, and what I can read with examples on how to understand approaching this challenge..
    Thank you for any help.
    -= Bruce D. Meyer

    The reason for the parsing (I thought I explained it, must have been too vague) is I have about 30 agencies in a csv file.
    Each agency can be determined by their subnet(s) and domain(s)
    I need to put all lines in the csv relating to each agency in their own separate csv file to distribute to them so I am not sharing agency 'A' info with the other 29 agencies.
    I get the regex comment. Thank you. For some reason I am rather hesitant to use PCRE under windows. I'll see how it works.
    Your comment on "Reloading a large file repeatedly takes more time", is the exact reason why I asked the question. I want to get away from that.
    I appreciate your quick reply, I think your example will work nicely. 
    -= Bruce

Maybe you are looking for

  • Question about Forte...

    Ok, I'm pretty sure this is the wrong forum to ask, but I haven't found a better one. I apologize for that. Now, I've just downloaded and installed Forte for Java CE. It installs fine, when I run it it shows the nice pic where it loads and initialize

  • Keyboard shortcut for "Clear" brush mode?

    I saw on this site http://helpx.adobe.com/en/photoshop/using/default-keyboard-shortcuts.html#WS17DDC46E-8F05- 4250-8CFC-EE0AB2E6EF84a that the keyboard shortcut for CLEAR brush blending mode was shift+alt+R for windows. I tried it but I keep hearing

  • Subpartitions NUM_ROWS not displaying

    i have created the table as create table range2 (roll number, age number) partition by range (roll) subpartition by range(age) (partition p1 values less than (100) (subpartition p1sp1 values less than (30), subpartition p1sp2 values less than (60), s

  • Integration of BOBJ Design Studio dashboard via SAP EP

    My client is currently piloting the implementation of a BusinessObjects Design Studio dashboard.  For maximum flexibility, the Add-on for BI Platform (BIP) has been installed, and we are able to successfully execute the dashboard from the BOBJ LauchP

  • ITunes does not sync calendars due to error

    itunes can not sync my calendars with my iPhone 5. It says it encounters an error  but no error message shows up. This started after I tried to try iCloud and had so much trouble I turned iCloud off. Is there any where I can find where the error is a