Loop through the rows

Hi all,
I have a requirement in oaf. I have created a Master detail sort of web page. Based on ceratin search fields the results table gets populated. Now this result table has check box on each row. When ever the user checks the check bow for say row1 and 5, those Shipment_Id (included in the VO) should be passed to a pl/sql pkg.
I am trapping the event in CO and passing the prameter to the AM wher the pkg.proc is called to which this parameter is passed. But I need to get only those row's ID for which the check box is checked. How do I achieve this? Pls do pass the sample code if any.

I made the changes:
public void Acknowledge()
OAViewObject vo = getAsnVO1();
int fetchedRowCount = vo.getFetchedRowCount();
RowSetIterator selectIter = vo.createRowSetIterator("selectIter");
if (fetchedRowCount > 0)
// Save the original range size and range start.
selectIter.setRangeStart(0);
selectIter.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
AsnVORowImpl rowi = (AsnVORowImpl)selectIter.getRowAtRangeIndex(i);
String selectFlag = rowi.getSelectFlag()+"";
String ShipmentLineId1=rowi.getShipmentLineId;
if("Y".equals(selectFlag))
// Getting selected row.
System.out.println("inside AM submit request method ");
System.out.println("*********calling pl/sql prog**************");
CallableStatement st = null;
try
String stmt ="begin pkg.proc(p_supply_source_id =>"+ShipmentLineId1"+); end; ";
OADBTransaction tr = getOADBTransaction();
st = tr.createCallableStatement(stmt, 1);
st.close();
OAExceptionUtils.checkErrors(tr);
catch(SQLException sqle)
throw OAException.wrapperException(sqle);
selectIter.closeRowSetIterator();
Error(175,100): ';' expected
Error(163,29): variable getShipmentLineId not found in class xx.oracle.apps.bps.asn.server.AsnVORowImpl
Line: 175 is String stmt ="begin xxbp_del_from_supp_pkg.Delete_Mtl_Supply(p_supply_source_id =>"+ShipmentLineId1"+); end; ";
Line 163 is :
String ShipmentLineId1=rowi.getShipmentLineId;
In my Vorowimpl i have that getshipmnetlineid, stil getting that error.
* Gets the attribute value for the calculated attribute ShipmentLineId
public String getShipmentLineId()
return (String)getAttributeInternal(SHIPMENTLINEID);
Actually it is a number. But in my VO it is a string. That should not be a prob i guess.

Similar Messages

  • JDev 10.1.3.4: How to properly loop through the rows of a VO?

    Hi,
    This is a newbie question. Using JDeveloper 10.1.3.4 I am trying to loop through the rows of a view object. I am sure that the VO returns the following rows in that order:
    200809
    200902
    200906If I use this code (where termsOpen is the VO instance):
    while (termsOpen.hasNext()) {
       System.out.println(termsOpen.getCurrentRow().getAttribute("Term"));
    }it proves to be an endless loop and I get "200809" printed on the console endlessly. The API says that hasNext() "does not move the current row". A book says that the pointer initially is at row 0. I wonder why it prints the first row. So the code is changed to:
    while (termsOpen.hasNext()) {
       Row currRow = termsOpen.next();
       System.out.println(currRow.getAttribute("Term"));
    }But now I get only the last two rows printed on the console, and do not get to see the first row:
    200902
    200906What's wrong?
    Thanks for helping!
    Newman

    Hi, Branislav,
    Thank you for the suggestion.
    I tried that also. When the code is
    while (termsOpen.hasNext()) {
       System.out.println(termsOpen.getCurrentRow().getAttribute("Term"));
       termsOpen.next();
    }I get only the first two rows and last row is dropped:
    200809
    200902To get all the three row, I end up using this code:
    System.out.println(termsOpen.first().getAttribute("Term"));
    while (termsOpen.hasNext()) {
       Row currRow = termsOpen.next();
       System.out.println(currRow.getAttribute("Term"));
    }But that shouldn't be the way of doing the work. If I use a block of 50 lines of code to process each row, the code will have to be written once before the while loop and another time inside the while loop.
    The book which says that the pointer starts at the row slot before the first row is found on the internet, on p.469. It makes sense to me that the pointer starts at row 0. But unfortunately the actual copy of JDev 10.1.3.4 I am using behaves otherwise.
    Newman

  • Powershell - Daily disk and folder usage; trouble with code to loop through the individual folders

    Hi,
    I'm very new to Powershell but through the help of this forum and the help on the internet I have scraped together a script that will loop through the disks of a set of servers listed in a text document, and give the capacity statistics in html
    format.
    I have two questions. I've tried modifying this to also loop though the individual folders on each disk and give the amount of space used to no avail. does any one have any suggestions?
    Secondly, how do I get this to append? all I want to do is set up a scheduled task that runs this report daily. I know I will need to add a date column, but I just want the data to append to the previous set of results.
    Thanks for any advice in advance.
    # Continue even if there are errors
    $ErrorActionPreference = "Continue";
    # Set your warning and critical thresholds
    $percentWarning = 100;
    $percentCritcal = 15;
    # REPORT PROPERTIES
    # Path to the report
    $reportPath = "C:\";
    # Report name
    $reportName = "DiskSpaceReport_$(get-date -format ddMMyyyy).html";
    # Path and Report name together
    $diskReport = $reportPath + $reportName
    #Set colors for table cell backgrounds
    $redColor = "#FF0000"
    $orangeColor = "#FBB917"
    $whiteColor = "#FFFFFF"
    # Count if any computers have low disk space. Do not send report if less than 1.
    $i = 0;
    # Get computer list to check disk space
    $computers = Get-Content "C:\serverlist.txt";
    $datetime = Get-Date -Format "dd-MM-yyyy_HHmmss";
    # Create and write HTML Header of report
    $titleDate = get-date -uformat "%d-%m-%Y - %A"
    $header = "
    <html>
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
    <title>DiskSpace Report</title>
    <STYLE TYPE='text/css'>
    <!--
    td {
    font-family: Calibri;
    font-size: 12px;
    border-top: 1px solid #999999;
    border-right: 1px solid #999999;
    border-bottom: 1px solid #999999;
    border-left: 1px solid #999999;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    body {
    margin-left: 5px;
    margin-top: 5px;
    margin-right: 0px;
    margin-bottom: 10px;
    table {
    border: thin solid #000000;
    -->
    </style>
    </head>
    <body>
    <table width='100%'>
    <tr bgcolor='#0B6121'>
    <td colspan='7' height='30' align='center'>
    <font face='calibri' color='#E0F8F7' size='4'><strong>Daily Disk Utilization Report for $titledate</strong></font>
    </td>
    </tr>
    </table>
    Add-Content $diskReport $header
    # Create and write Table header for report
    $tableHeader = "
    <table width='100%'><tbody>
    <tr bgcolor=#E0F8F7>
    <td width='10%' align='center'>Server</td>
    <td width='5%' align='center'>Drive</td>
    <td width='15%' align='center'>Drive Label</td>
    <td width='10%' align='center'>Total Capacity(GB)</td>
    <td width='10%' align='center'>Used Capacity(GB)</td>
    <td width='10%' align='center'>Free Space(GB)</td>
    <td width='5%' align='center'>Freespace %</td>
    <td width='5%' align='center'>RAM %</td>
    <td width='5%' align='center'>CPU %</td>
    </tr>
    Add-Content $diskReport $tableHeader
    # Start processing disk space
    foreach($computer in $computers)
    $disks = Get-WmiObject -ComputerName $computer -Class Win32_LogicalDisk -Filter #"DriveType = 3"
    $computer = $computer.toupper()
    foreach($disk in $disks)
    $deviceID = $disk.DeviceID;
    $volName = $disk.VolumeName;
    [float]$size = $disk.Size;
    [float]$freespace = $disk.FreeSpace;
    $percentFree = [Math]::Round(($freespace / $size) * 100);
    $sizeGB = [Math]::Round($size / 1073741824, 2);
    $freeSpaceGB = [Math]::Round($freespace / 1073741824, 2);
    $usedSpaceGB = $sizeGB - $freeSpaceGB;
    $color = $whiteColor;
    # Start processing RAM
    $RAM = Get-WmiObject -ComputerName $computer -Class Win32_OperatingSystem
    $RAMtotal = $RAM.TotalVisibleMemorySize;
    $RAMAvail = $RAM.FreePhysicalMemory;
    $RAMpercent = [Math]::Round(($RAMavail / $RAMTotal) * 100);
    # Set background color to Orange if just a warning
    if($percentFree -lt $percentWarning)
    $color = $orangeColor
    # Set background color to Orange if space is Critical
    if($percentFree -lt $percentCritcal)
    $color = $redColor
    # Create table data rows
    $dataRow = "
    <tr>
    <td width='10%'>$computer</td>
    <td width='5%' align='center'>$deviceID</td>
    <td width='10%' >$volName</td>
    <td width='10%' align='center'>$sizeGB</td>
    <td width='10%' align='center'>$usedSpaceGB</td>
    <td width='10%' align='center'>$freeSpaceGB</td>
    <td width='5%' bgcolor=`'$color`' align='center'>$percentFree</td>
    <td width='5%' align='center'>$RAMpercent</td>
    <td width='5%' align='center'>$CPUpercent</td>
    </tr>
    Add-Content $diskReport $dataRow;
    Write-Host -ForegroundColor DarkYellow "$computer $deviceID percentage free space = $percentFree";
    $i++
    # Create table at end of report showing legend of colors for the critical and warning
    $tableDescription = "
    </table><br><table width='20%'>
    <tr bgcolor='White'>
    <td width='10%' align='center' bgcolor='#FBB917'>No Warning</td>
    <td width='10%' align='center' bgcolor='#FF0000'>Critical less than 10% free space</td>
    </tr>
    Add-Content $diskReport $tableDescription
    Add-Content $diskReport "</body></html>"

    The only easy way to create a report like this that accumulates is to design it so the data is output to a CSV file or a database.  YOu can then generate the HTML from the persist6ed data.
    If you store as XML you can use XSLT (transform) to convert to an HTML report.
    I also recommend uing Excel as an HTML report generator.  It is much easier and more flexible.  PowerShell is not intended to do what you want without designing a whole custom reporting system.
    Use the right tool for the right task.
    Just because you own a hammer does not mean that the solution to every problem includes a nail.
    ¯\_(ツ)_/¯

  • Looping through the resultset

    Post Author: Swapna
    CA Forum: Formula
    Hi
      I need to loop through the result set how would i do that here is my scenario
    in the database i have total 10 columns say an example
    a,b,c,d,e,f,g,h,i,j,k and assume i have 100 rows with allthese values in the database now for these 100 rows i have to calculate the summary of those columns and i have written formula something like this but it was not working it was giving me zero dont know plz advise on this
    whileprintingrecords;
    numbervar totalsum;
    totalsum=totalsum((a-b)/100cdefghi-j-k);
    and i want to display this sum in my detail section of report how would i do that
    I Appreciate your help.

    Post Author: SKodidine
    CA Forum: Formula
    Try this and see if you get any results.
    totalsum=totalsum((a-b)/100cdefghi-j-k);
    totalsum := totalsum((a-b)/100cdefghi-j-k);

  • LOOPING THROUGH THE BLOCK

    Can anybody help me with an example or materail which explains how can we loop through a block in Forms 6i?
    Also how we can loop through the details block pertaining to the master block and process those records also?
    Thanks

    The quickest way to do something is not to do it at all, and this looks like a good example of where you don't need to do anything - what I suspect you really need is a better design for your schema. What are you updating that requires an update on all child records and cannot simply be referenced when you query a child record?
    If you can't change the schema and you have millions of records to update then your best bet is to use sql, then try pl/sql if sql can't do the job. Only try forms if you absolutely have to, and expect it to run like a brick.
    In forms (assuming you're using relationships):
    go to each block, do first_record and process each record.
    go to the lowest child block and loop through the records using next_record until "system.last_record = 'TRUE'", processing each record as you go.
    go to the next block up, do next_record and process that record.
    go back to the lowest child block and loop though it, processing each record.
    when you have reached the last record in the penultimate child block then go to its immediate parent block, do next_record and process that record.
    go to the lowest child block etc etc etc
    There are a lot of things which you can do in forms but which belong on the database!

  • Does anyone know a way to programatically loop through the items in the document library

    A lot of the funcations like deleteSymbol and updateSymbol depend on which items are "selected" in the library panel.
    Is there a way to programatically access these selections?
    or
    Loop through the library?
    or
    Set selections?

    Yup, I've asked for an API to access the selection in those panels for years, to no avail.
    Note that you can loop through layers, frames and pages, but you can't tell what the user has selected in the actual panel UI.  Also, you can't find out which symbols are currently used in the document.  Nor can you programmatically insert a rich symbol into the document and have it maintain its "richness".

  • Script code sample for looping  through the records from xml data file in formCalc script

    Hi
       I have a xml data file which contains a sequence of repeating applicant data like given below
                       US
                       II
                       CEO
                       Mr
                       111111111
                       0000000111
                       GuarantorA
                       111
                       IN
                       11111
                       WILLIAMS1
                       R3
                       KENNETH1
                       City1GU
                       PA
                       1934-03-14
                       [email protected]
                       GU
                       R
                       113 Lazlo LaneCA
                       Suite 3500CA
                       OaklandCA
                       TX
                       11345
                       AL
    I want to assign a textfield with a value based on the value of coap_flag.
    So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
    I am new to Adobe livecycle...Please help me how it can be done.
    I have developed something like this
    foreach Item in ($record.applicant[*].coap_flag) do
    test.value=Item
    if(test.value=="MA")then
    concat($record.applicant.first_name,$record.applicant.middle_name)endif
    endfor

    Using the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br />     //set the currentElement to the 1st child node<br />     currentElement = obj.item(i);<br />     //Check to see if it is an applicant node<br />     if (currentElement.name == "applicant"){<br />          //It is an applican, now find the coap_flag node value and write it to the text field<br />          TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br />     }<br />}

  • Loop through the records from xml data file in formCalc script

    Hi
       I have a xml data file which contains a sequence of repeating  applicant data like given below
                               US
                                II
                                CEO
                                Mr
                                111111111
                                0000000111
                                GuarantorA
                                111
                                IN
                                11111
                                WILLIAMS1
                                R3
                                KENNETH1
                                City1GU
                                PA
                                1934-03-14
                                [email protected]
                                GU
                                R
                                     113 Lazlo LaneCA
                                     Suite 3500CA
                                     OaklandCA
                                     TX
                                     11345
                                     AL
    I want to assign a textfield with a value based on the value of coap_flag.
    So i need to loop through all the record and check the value of coap_flag and then assign the textfield a value based on that.
    I am new to Adobe livecycle...Please help me how it can be done.
    I have developed something like this
    foreach Item in ($record.applicant[*].coap_flag) do
    test.value=Item
    if(test.value=="MA")then
    concat($record.applicant.first_name,$record.applicant.middle_name)endif
    endfor

    Using the data you posted in the forum, I copied it a couple of times to give multiple records and used this code to extract the different values that you wanted. I had to wrap it in a <root> node that I called root (to make it valid XML). In my case I wrote the extracted values to a field, but in your case you can do whatever you want with them. Note that this was done in javascript:<br /><br />var currentElement;<br />var obj;<br /><br />//Get the nodes below the root node in the dataDom<br />obj = xfa.datasets.data.root.nodes;<br /><br />//Set an initial value for the textField<br />TextField1.rawValue = "The values of the coap_flag are: ";<br /><br />//Loop through the nodes in the obj set <br />for (i=0; i< obj.length ; i++){<br />     //set the currentElement to the 1st child node<br />     currentElement = obj.item(i);<br />     //Check to see if it is an applicant node<br />     if (currentElement.name == "applicant"){<br />          //It is an applican, now find the coap_flag node value and write it to the text field<br />          TextField1.rawValue += "\n" + xfa.resolveNode("xfa.datasets.data.root.applicant[" + i + "]").coap_flag.value;<br />     }<br />}

  • Multi-record block (how do I loop through the block)

    I created a two canvas form. On the first canvas, the user enters data and selects 1 - 30
    reports that they want to run. When they click on <NEXT> button, I create a multi-record
    control block and display each record on the second screen using
    go_block;
    clear_block;
    move data;
    create_record;
    The user then selects on the second canvas which reports to run now and which to run later via
    a LOV. When they press the <RUN> button, I want to start at the first record and either run the
    report or schedule it. Then I want to move onto the second and the third until all selected reports
    have been handled. I know I should use a loop but can't seem to make it work.
    So my question is, How do I loop through the records in a multi-record control block, pass the information
    for that one record to a parameter form and then execute the request? Each control block record contains
    10 parameter fields.
    Thanks.
    Bob

    go_record(1);
    << do your processing >> -- This is executed only for the first record.
    if :system.last_record = 'TRUE' then -- If the 1st record is also the last record.
    RETURN;
    end if;
    LOOP
    next_record;
    << do your processing >>
    if :system.last_record = 'TRUE' then
    EXIT;
    end if;
    END LOOP;
    I created a two canvas form. On the first canvas, the user enters data and selects 1 - 30
    reports that they want to run. When they click on <NEXT> button, I create a multi-record
    control block and display each record on the second screen using
    go_block;
    clear_block;
    move data;
    create_record;
    The user then selects on the second canvas which reports to run now and which to run later via
    a LOV. When they press the <RUN> button, I want to start at the first record and either run the
    report or schedule it. Then I want to move onto the second and the third until all selected reports
    have been handled. I know I should use a loop but can't seem to make it work.
    So my question is, How do I loop through the records in a multi-record control block, pass the information
    for that one record to a parameter form and then execute the request? Each control block record contains
    10 parameter fields.
    Thanks.
    Bob

  • 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

  • How to loop through the "On My Mac" folders in mail?

    Hi there - i am new to applescript, but am slowly working out how to use it.
    I am stumped on how to write a rule that will move a message to a folder identified by a tag in a message (I am using MailTags).
    I have script that will take the first tag and move the message to a mail folder in a fixed location (e.g. Archive/<tag name>) however I wanted to make it more generic by looping over all of my mail folders and finding one that matched the tag name.
    However I am stumped on how to loop over all of my mail folder names - I have tried:
    repeat with aFolder in (every mailbox of (mailbox for "ON MY MAC"))
    and
    repeat with aFolder in every mailbox of inbox
    etc.
    but none of these seem to work.
    Is there some magic syntax to do this, so that I can do:
    if (name of aFolder = msgTag) then
    move oneMessage to mailbox (name of aFolder)
    end if
    Tim

    You don't necessarily need to assign a variable to the entire list in order to loop through them (unless you really want to) - for example:
    tell application "Mail" to repeat with aFolder in (get mailboxes)
            -- do stuff with aFolder
    end repeat
    There are several AppleScript resources, but the main ones I use are:
    AppleScript Language Guide
    AppleScript Tutorials at MacScripter.net

  • Crash whilst looping through Excel rows

    Hi Folks.
    I have a program unit in forms which opens an XL spreadsheet and then reads the rows into the DB.
    It loops though about 4800 rows and then the whole app dies and forms closes. No error is given.
    The code is shown below. If anyone has any suggestions I'd love to hear them.
    I have increased the size of the table.
    Cheers
    Simon
    ** Module Name :
    ** Package name :
    ** Author : Simon Gadd
    ** Creation Date: 01-NOV-2002
    ** Called By :     
    ** Calls :
    ** Description :
    ** Dev Location :
    ** Test Location:
    ** Modification     History:
    ** =====================
    ** Date      Author Description
    ** =============      =============== ======================================================
    PROCEDURE XLSR_CLIENT_NORTM_DATA IS
         appID                    PLS_INTEGER;
         convID               PLS_INTEGER;
         docID                    PLS_INTEGER;
         buffer_1                         NUMBER(10);
         buffer_2                         VARCHAR2(100);               
         p_pmn                                   CHAR(5);     
         tap_sequence_no          NUMBER(5);
         sdr_gross                         NUMBER(12,3);
         next_row                              NUMBER(4);
         next_column                         NUMBER(4);
         last_row                              NUMBER(4) := 7560;
         last_column                         NUMBER(4);
         cell_reference               VARCHAR2(10);
         app_dir                                   VARCHAR2(100)     := 'C:\Program Files\Microsoft Office\Office\Excel.exe';
         data_source_dir               VARCHAR2(13)      := 'C:\FCSS\TEMP';
         data_source_file          VARCHAR2(21)      := 'NIUNORTM0209.xls';
         data_source                         VARCHAR2(50);
         dde_commmand                    VARCHAR2(200);
         r                                              VARCHAR2(100);
         txt                                             VARCHAR2(20);
         err_txt                                   VARCHAR2(100);
         a_pmn                                        CHAR(5) := 'NORTM';
    valid_nmt                              BOOLEAN;          
    BEGIN
         -- Clean out any existing data from XLS_C32
         DELETE FROM TAP_FILE_DELTA_AP WHERE PMN LIKE '%';
         DELETE FROM TAP_FILE_DELTA_AP_ERR WHERE PMN LIKE '%';
         COMMIT;
         SHOW_STATUS ('Attempting to open Excel');
         -- Start exel, load the source file
         data_source          := data_source_dir||'\'||data_source_file;
         dde_commmand     := app_dir||' '||data_source;
    appID := DDE.App_Begin ( dde_commmand, DDE.APP_MODE_MINIMIZED);
    UPDATE_STATUS ('Started Excel ');
    -- Initiate a conversation with the source
    docID := DDE.INITIATE ('EXCEL',data_source);
    UPDATE_STATUS ('Opened source file ');
         -- Get the last row to read
         --last_row := get_last_cell(docID);
         FOR i IN 5 .. last_row LOOP
         -- Read the next row
                   -- IF THE VALUE OF THIS CELL IS A VALID PMN CODE THEN
                   -- READ THE REST OF THE LINE
                   -- IF IT IS NOT, RECORD THE LINE NUMBER INTO THE CORRESPONDING ERROR
                   -- TABLE. USERS NEEDS TO ANALYSE THE ERROR TABLES AND IF REQUIRED
                   -- UPDATE THE VALID PMN CODES (OPERATORS TABLE)
              BEGIN
                   next_row     := i;
                   err_txt := 'Unable to get data from '||'R'||i||'C3';
                   DDE.REQUEST(docID, 'R'||i||'C3', buffer_2,DDE.CF_TEXT,10000);
                   err_txt := 'Unable to translate data';
                   p_pmn := SUBSTR(buffer_2,1,5);
                   SHOW_STATUS('Processing ' ||i||' '||p_pmn);
                   err_txt := 'Unregistered PMN code ?';
              valid_nmt := is_the_pmn_valid (p_pmn);     
              IF (valid_nmt = TRUE) THEN          
                        DDE.REQUEST(docID, 'R'||i||'C3', buffer_2,DDE.CF_TEXT,1000);
                        p_pmn := SUBSTR(buffer_2,1,5);
                        err_txt := 'Reading TAP sequence no';
                        cell_reference := 'R'||i||'C5';                                    
                        tap_sequence_no := GET_CELL_NUMBER (docID, cell_reference);
                        err_txt := 'Reading GROSS SDR';
                        cell_reference := 'R'||i||'C6';                                    
                        sdr_gross := GET_CELL_NUMBER (docID, cell_reference);
                        -- ADD DATA TO TABLE TAP_FILE_DELTA_AP
                   INSERT INTO TAP_FILE_DELTA_AP
                        VALUES
                             a_pmn, -- VC2(5)
                             p_pmn, -- VC2(5)
                             tap_sequence_no,-- NUM(10)
                             sdr_gross, --NUM(12,3)
                             NULL,
                             NULL
                        COMMIT;
                        -- let the user know what is going on
                   r :=      'Row '||i||' > '||p_pmn;
                        SHOW_STATUS (r);               
              ELSE
                   INSERT INTO TAP_FILE_DELTA_AP_ERR
                        VALUES
                                  a_pmn,
                                  p_pmn,
                                  err_txt                         
                   COMMIT;     
              END IF;
              EXCEPTION
                   WHEN OTHERS THEN                    
                        INSERT INTO TAP_FILE_DELTA_AP_ERR
                             VALUES
                                       a_pmn,
                                       p_pmn,
                                       err_txt
                   COMMIT;          
         END;
         END LOOP;
    -- Terminate a conversation with the source               
         DDE.TERMINATE (docID);
    DDE.App_End (appID);
    SHOW_STATUS ('Done - Reading');     
    SHOW_STATUS ('Calculating Differences - Please Wait');
    XLSR_CLIENT_NORTM_DATA_PROCESS (a_pmn);
    SHOW_STATUS ('Done - Calculating Differences');     
    END;

    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 the excel files in folder and sub folder

    hi all
    I need to loop  through all the excel fies in a folder and its sub folder which contain excel files 
    actually, my excel files contain a column  with sdate and it contain different dates in which  has to get the max  date my query is 
    "select * from  @[User::filename] where sdate=(select max(sdate) asi  from @[User::filename] )"
    loop  all the excel file in folder and its sub folder

    Take a look at the Foreach Loop.
    Here is an article about it.
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • Loop through the collection of elements and give 15 elements in each iteration.

    For example I have 100 pnr numers and i need 15 set of pnrs each time i iterate through the 100 pnrs using XQUERY.
    I have to hit a service to get PNR details , I have 100 PNR's but I can hit only with 15 at a time

    Hello,
    Did the issue resolved? Just as Visakh16 post above, it is hard to interpret without the sample data. Please post more details for further analysis.
    You can refer to the following article about FLWOR Statement and Iteration in XQuery:
    http://technet.microsoft.com/en-us/library/ms190945.aspx
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Ipod nano would'nt play, just kept looping through the songs.

    My nano is only six weeks old. It was playing fine but then suddenly stopped playing and would only go through the songs and then go back to the main screen. I just wondered if anyone ever experienced this same problem.

    i had the same problem and i couldnt figure out what to do so i sent it back to apple and i got it back within a week and it worked fine but all my music was off of it. but it worked and it was free.

Maybe you are looking for

  • PO Stylesheet How to remove space between two tables

    Hi I am building a rtf template for PO output for communication report in r12,there is a terms and conditions part and total amount part which comes at bottom of every page of the report. I have created that as a template and i call it in the footer.

  • Need help on submitting ALTER SYSTEM command.

    I have a report of a list of active xml threads from our EM repository, which is pulled from 4 RAC instances. I have a region with this statement: select a.inst_id, a.sid,a.serial#,b.instance_name, b.host_name, a.machine, a.status from gv$session@emr

  • Duplicate text messages in messages+

    I am receiving duplicate text messages when using messages+ as my default app.  A msg I send is sent twice & I receive messages twice.  This just started about two weeks ago.   I have had my galaxy5 for two months.  I turned off the stock app yesterd

  • Muse Crashes - Where's the Love? App Launch Failures & Database Errors

    I really love Adobe Muse but I'm really frustrated by it's instability. There are two general problems that I consistently experience. App Launch Issues Firstly, and an issue I am experiencing right now is, a launch error where the program refuses to

  • Slow network game

    Hi. I am trying to make a multiplayer network game. I got the game to work over a network connection, but there is a delay when I send and receive data and the delay seems to get bigger the longer the program runs. As you can see, I send 20 bytes and