Loop through a group of tables

Someone who can help me with: I need to go a group of tables in a database, which have a common field. The idea is to do a select on that field in common according to a query criteria. thanks

create table table1 as
(select rid,identification,
        decode(identification,1,'Al',2,'Bo',3,'Che',4,'Doe',5,'Ed',6,'Fox',7,'Gil',8,'Hoss',9,'Ian',10,'Joe',11,'Ken',12,'Lou',13,'Moe',14,'Ned',15,'Oz',16,'Poe',17,'Red',18,'Sy',19,'Ted','Vic') name,
        Initcap(dbms_random.string('l',dbms_random.value(5,15))||' '||dbms_random.string('l',dbms_random.value(5,10))||' '||dbms_random.string('l',dbms_random.value(5,20))) info
   from (select level rid,
                trunc(dbms_random.value(1,20)) identification
           from dual
         connect by level <= 10
RID
IDENTIFICATION
NAME
INFO
1
8
Hoss
Iqvispa Lmurse Zuzaozjmgruxk
2
5
Ed
Lomqevifqeeeo Nxlxnhdv Wlakstxjms
3
18
Sy
Znaked Eoenhxeeca Nrxpwjyt
4
14
Ned
Jbiebqxcowrw Ipuqfm Zlbjiumygtcnfgiq
5
16
Poe
Jmbwzhodm Ujcxeubr Ucikapudanbtyhrbla
6
11
Ken
Nwcdowlndfb Lzekz Fwmjhcufw
7
16
Poe
Ltiyuz Zuyevvf Ngeyowyyjvrh
8
2
Bo
Zrifwczbkktcouc Izpmaib Tmhkqatyahzuguwpw
9
6
Fox
Tsrghyzi Qdutdqqm Takrtwv
10
12
Lou
Zfgyftaidslpcg Osexqg Owaoafoipgn
RID
IDENTIFICATION
NAME
INFO
1
2
Bo
Agabtq Tanivdo Hiaybiuyyktitvwgjp
2
12
Lou
Znvcvycgllx Gtewsxz Lziuom
3
13
Moe
Qdzurj Cgdfmtslee Emtvhupylnalelbbacv
4
17
Red
Nwjjmqkfpxn Hiywfb Hrveoiegppo
5
1
Al
Bhnyjgnkmlsu Jbrdmiu Adwbpzbelyrebfq
6
11
Ken
Hsnccafffl Okfpeodw Znrmbrnxkxwi
7
8
Hoss
Olvwgjhtejhu Nvbofegy Kbanybopcg
8
1
Al
Cvnwwaw Hhzwsb Peuruso
9
19
Ted
Xuykzepjpdjrc Mmnxfdc Cdwfjvv
10
19
Ted
Zqmhv Mqxkio Mpbssxxurbxtaifud
RID
IDENTIFICATION
NAME
INFO
1
16
Poe
Gappv Ptkkgqh Zfbkoeb
2
3
Che
Ggbughdb Icdiwl Imtfng
3
9
Ian
Cadwemch Ckwdlrxs Kzdpanneushpp
4
7
Gil
Frlufjrk Amidybzd Rwlwqfxp
5
10
Joe
Rqvhbh Rbpdaklmsz Nhzkeblzmdgxvx
6
19
Ted
Sphkzeoean Epllenxz Cdpikiftoacwqrw
7
9
Ian
Ntovrotmwdaago Bpvdxmeofr Qfnpl
8
19
Ted
Sjookoa Ilotrpqyz Eaabfufbeeflb
9
17
Red
Pvzmbjepm Vevqae Oqnezylttqz
10
2
Bo
Rbjseracpal Exvukmsvt Auujopmdawrwzz
RID
IDENTIFICATION
NAME
INFO
1
12
Lou
Rmbjqggtwgvkuq Mgdxelhg Mcjsxldszzvsbnpex
2
15
Oz
Zdmfqyiqz Wrepkbn Jmvfrcwegqdxjeo
3
15
Oz
Klkzrjhvxo Xftxbac Ovhsvuvrvof
4
7
Gil
Pzktxz Kkopip Irfixa
5
17
Red
Hegcugpqxn Trdtcmkq Wljbm
6
1
Al
Pvlrqg Ceamqdxzh Mieubwiul
7
5
Ed
Uejsqrghek Yrqjfkjy Itnwowljg
8
13
Moe
Llguurt Hiqfycrkel Pcftjjbvbwimsqqlt
9
7
Gil
Hnsaeflly Arbml Ovmcwrzfqyy
10
2
Bo
Hmzxxlzvoqskjsx Itandsik Pxlqcdnxkv
RID
IDENTIFICATION
NAME
INFO
1
8
Hoss
Oogcgbjsmmqm Vxpknalu Hbxfvydnfdnqz
2
1
Al
Xaejofaeramguil Rtmtcbkpp Adpmrsytubflyfhoda
3
3
Che
Weyphtako Xendsrx Uhhatkyzhptgkg
4
15
Oz
Lhwpxgfvyh Xdvvcv Bxtueffbzkri
5
1
Al
Mjtpycls Myxftbcb Edbytrjwzppfdkqyn
6
2
Bo
Gujxzuzogigwdo Htzvfsfnh Cekmyezwlyuzcp
7
4

Similar Messages

  • How to loop through columns of a table?

    Hi, guys
    Is there a way to loop through each column of a table? If there is a way, then how?
    I have a table with columns of different datatypes , and I want to set default values for each column with a loop but don't know how to make it happen.
    For example,
    Table: Employees
    declare
      rec  Employees%ROWTYPE;
    begin
      for col in rec.empno .. rec.location loop
         if col = rec.empno then -- set default value for column empno;
      end loop;
    end;
    /Sorry, I am a newbie to PL/SQL. Please help!
    Thanks in advance.
    Edited by: HappyJay on 2010/05/11 10:36

    Hi,
    You can query the data dictionary views all_tab_columns (or user_tab_columns) to get the names of all the columns in a particular table.
    Here's an easy way (but not a very efficient way) to loop through them:
    SET     SERVEROUTPUT     ON
    BEGIN
         FOR  c IN ( SELECT  column_name
                         FROM    all_tab_columns
                  WHERE   owner     = 'SCOTT'     -- Remember ot use UPPER CASE inside quotes
                  AND         table_name     = 'EMP'
         LOOP
              dbms_output.put_line (c.column_name || ' = column_name inside loop');
         END LOOP;
    END;
    /I'm confused about what you want to do, though.
    Do you want the PL/SQL code to write and/or execute an ALTER TABLE command for each column?

  • Fastest way to loop through a group of strings

    I am trying to optimize a small class that loops through an array of strings and compares to see if another string equals one of the values, for example:
    String test = "this is test5";
    String array[] = {"test1","test2","test3, test4,test5,test6,test7,test8"};
    for(int i = 0;i < array.length; i++)
    if (test.endsWith(array))
    return array[i];
    }The array that I am using holds closer to 15 values, but this loop can be hit thousands of times a day.  My  question is, are there any faster ways to loop through multiple strings than using arrays?  How do array lists or maps compare?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    sarcasteak wrote:
    The array that I am using holds closer to 15 values, but this loop can be hit thousands of times a day. 15,000 comparisons a day is nothing. The following code does 15 million String compares in 188 ms.
    public class StrCmp {
      public static void main(String... args) {
        String[] arr = {"abc", "sdfasdlfkjasldfjalsdkfj", "234l2kjala34kh", "slkfjal3490u saf",
                        "234lkjasldfhk23k4jhasf", "23l4kjsf", "alsflsdjkf", "aslkdfajsdf3h", "zzzzz",
                        "uhuhuhuhuh", "uhu2huh234234", "n234aoiuf", "234lasdhvoaih3", "zoziucvoiu", "asdflsjfl"};
        long start = System.currentTimeMillis ();
        for (int i = 0; i < 1000000; i++) {
          String str = "qqq";
          for (String str2 : arr) {
            if (str2.endsWith (str)) {
              System.out.println ("match");
        long end = System.currentTimeMillis ();
        System.out.println((end - start) + " millis");
    My question is, are there any faster ways to loop through multiple strings than using arrays? How do array lists or maps compare?Before you worry about taking something simple that works and complicating it to make it faster, make sure there's a reason to do so.
    If you do in fact need to make it faster, there are several different things you could do, but which one is best depends on a number of factors specific to your particular requirements and use cases.

  • Loop through records in a table and update

    Hi there,
    Need some help here please. Sorry new to Oracle. I'm working with Oracle 10g.
    I have a table like this;
    ID Amount Date
    123 5000 Oct-07-2011
    123 null Oct-09-2011
    124 7000 Oct-14-2011
    124 null Oct-17-2011
    124 null Oct-24-2011
    What I'm trying to do here is loop thruogh the records and update the amount that's null with the previous amount with the same ID.
    Some sample code that I follow for this?
    Thanks very much for your help.

    maybe some of this example migth help.
    SQL> select id, amount, tdate
      2    from (select 123 id, 5000 amount, to_date('Oct-07-2011','mon-dd-rrrr') tdate from dual union all
      3          select 123 id, null amount, to_date('Oct-09-2011','mon-dd-rrrr') tdate from dual union all
      4          select 124 id, 7000 amount, to_date('Oct-14-2011','mon-dd-rrrr') tdate from dual union all
      5          select 124 id, null amount, to_date('Oct-17-2011','mon-dd-rrrr') tdate from dual union all
      6          select 124 id, null amount, to_date('Oct-24-2011','mon-dd-rrrr') tdate from dual union all
      7          select 124 id, 8000 amount, to_date('Oct-25-2011','mon-dd-rrrr') tdate from dual union all
      8          select 124 id, null amount, to_date('Oct-28-2011','mon-dd-rrrr') tdate from dual)
      9  order by id, tdate;
            ID     AMOUNT TDATE
           123       5000 07-Oct-11
           123            09-Oct-11
           124       7000 14-Oct-11
           124            17-Oct-11
           124            24-Oct-11
           124       8000 25-Oct-11
           124            28-Oct-11
    7 rows selected
    SQL>
    SQL> select id,
      2         last_value(amount ignore nulls) over (partition by id order by tdate) amount,
      3         tdate
      4    from (select 123 id, 5000 amount, to_date('Oct-07-2011','mon-dd-rrrr') tdate from dual union all
      5          select 123 id, null amount, to_date('Oct-09-2011','mon-dd-rrrr') tdate from dual union all
      6          select 124 id, 7000 amount, to_date('Oct-14-2011','mon-dd-rrrr') tdate from dual union all
      7          select 124 id, null amount, to_date('Oct-17-2011','mon-dd-rrrr') tdate from dual union all
      8          select 124 id, null amount, to_date('Oct-24-2011','mon-dd-rrrr') tdate from dual union all
      9          select 124 id, 8000 amount, to_date('Oct-25-2011','mon-dd-rrrr') tdate from dual union all
    10          select 124 id, null amount, to_date('Oct-28-2011','mon-dd-rrrr') tdate from dual)
    11  order by id, tdate;
            ID     AMOUNT TDATE
           123       5000 07-Oct-11
           123       5000 09-Oct-11
           124       7000 14-Oct-11
           124       7000 17-Oct-11
           124       7000 24-Oct-11
           124       8000 25-Oct-11
           124       8000 28-Oct-11
    7 rows selected
    SQL>

  • CRXI: Formula To Loop Through Formulas in Group

    Post Author: Mile
    CA Forum: Formula
    I have a hierarchy of groups allowing the drilldown of data. Due to a flaw in database design, there is no real join between two tables and I've improvised as best I can. The problem is that on one of my items, there can be as many as thirteen products attributed to it. This produces thirteen records for the one item, meaning that summing on the amount field will be thirteen times the actual amount. But, as I said, each product may have a different number of products attributed to it, meaning it could be five times the amount, seven times, the amount, etc.
    I've been able to make a summary at the item level whereby all I need to do is a formula that divides the sum by the count of products to get the actual value. When I move to the next group level up, I find that it can't mathematically be done to divide the summed amount because one item in the group may have two products (therefore two records) and another ten products.
    What I'm wondering is whether there is a way, using a formula, that can loop through all the items in a group and add the summary field.
    i.e.
    ITEM1 - PROD1 - $5
    ITEM1 - PROD2 - $5
    ITEM2 - PROD1 - $7
    ITEM2 - PROD2 - $7
    ITEM2 - PROD3 - $7
    ITEM2 - PROD4 - $7
    ITEM2 - PROD5 - $7
    ITEM1 would summarise to $5, once I've divided it by two. ITEM2 would summarise to $7, once I've divided it by five.
    So, ideally, I would loop through a group above the item level, adding the summaries, ending with $12.
    Can this be done?

    Post Author: synapsevampire
    CA Forum: Formula
    Your difficulty is termed record or row inflation.
    If you want a summary at the group level, group by the item field and use a maximum instead of a sum.
    maximum({table.value},{table.item})
    Then to get a grand total, create a formula such as the following for the gropup footer:
    whileprintingrecords;numbervar MyTotal;MyTotal := MyTotal + {table.value}
    Now you can display the grand total in a subsequent secion using:
    whileprintingrecords;numbervar MyTotal
    -k

  • 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

  • BRF : Looping through a table (e.g. Do Until or While, etc..)

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

    Hello Colleagues,
    In BRFPLus I understand we can create Loop Expressions that allow you to loop through a table and perform different Actions based  on the retrieved contents of the table.
    We are not using BRFPLus (but the old BRF instead). Does anyone know how to build Loop Expressions in BRF without the use of ABAP Function Modules?
    Your feedback would be really appreciated.
    Thanks in advance.
    Regards,
    Ivor M.

  • Looping through a table

    how do I loop through the following table and get it to insert records into another depending on the number that it finds in the value column. eg if there is 8 in the value column, 8 records should be inserted into another table with the same ID
    i forgot to paste an example table
    ID
    Name
    Value
    1
    john
    12
    2
    sarah
    20
    3
    Tom
    5
    I want it to look at the value column and if it is 12 it should add 12 rows with the same ID into another table. eg in the new table there will be 12 rows for John with an ID of 1. For Sarah there will be 20 rows with an ID of 2.
    sukai

    Sure!
    DECLARE @sourceTable TABLE (ID INT, Name VARCHAR(20), Value INT)
    INSERT INTO @sourceTable (ID, Name, Value) VALUES (1, 'john', 12),(2, 'sarah', 20),(3, 'Tom', 5)
    This mocks up your source table (where your data is coming from). We're simply creating a table variable, and populating it with your example data.
    DECLARE @numbers TABLE (value INT)
    WHILE (SELECT COUNT(*) FROM @numbers) < (SELECT MAX(Value) FROM @sourceTable)
    BEGIN
    INSERT INTO @numbers (value) VALUES ((SELECT COUNT(*) FROM @numbers)+1)
    END
    This creates an example numbers table. The while causes the code to loop until there are as many rows as the maximum value for the Value column in your example data. Each time the loop iterates it inserts a row, causing the COUNT(*) to be one more each time,
    we add one to that, and insert it into the numbers table.
    INSERT INTO destinationTable
    SELECT s.ID, s.Name, s.Value
    FROM @sourceTable s
    INNER JOIN @numbers n
    ON s.Value >= n.value
    ORDER BY s.ID
    This performs an insert select to a made up table. We join the rows from @sourceTable (your example data) to the @numbers table where the Value column from @sourceTable is less than or equal to the value column in the numbers table. If s.Value is 1
    we'll perform this join once. If it's 2, twice and so on. This works because of the way we set up the numbers table. If we had insert multiple 1's it would cause additional joins.
    A numbers table is a handy tool to have for things like this were you need iterations. Create a database (or schema) on your database and call it something like 'Toolbox'. In that database/schema you can put things like this that have little to do with your
    actual data, but come in handy. You can make your numbers table as long as you need. It totally wouldn't hurt at all to have a numbers table with hundreds of thousands of rows. They're just int's, they don't eat much :).
    Let me know if you'd like anything clarified more.

  • How to loop through XML data in a table of XMLType?

    Hi,
    I am failry new to xml document processing in Oracle using PL/SQL.
    My DB version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    I have successfully loaded an xml document into a table using the following two statements:
    1) CREATE TABLE mytable2 OF XMLType;
    2) INSERT INTO mytable2 VALUES (XMLType(bfilename('IMAGE_FILE_LOC', 'IFTDISB20100330172157C002.xml'), nls_charset_id('AL32UTF8')));
    Now I need to traverse through the various nodes within the xml document and extract values of elements of each node. The question I have is:
    How do I loop through a node? A VALID record is enclosed within the <checkItem> </checkItem> tags.
    Here is a snippet of the data in that xml document:
    ++++++++++++++++++++++++++++++++++++++++++++++++
    <?xml version="1.0" encoding="UTF-8"?>
    <bdiData>
    <documentControlInfo>
    <documentInfo>
    <docDescription>Check images and data for Test Company, account number 1234567890</docDescription>
    <docID>
    <ID>20100330172157</ID>
    </docID>
    <docModifier>Test Company</docModifier>
    <docCreateDate>2010-03-30</docCreateDate>
    <docCreateTime>17:21:57-0700</docCreateTime>
    <standardVersion>1.0</standardVersion>
    <testIndicator>0</testIndicator>
    <resendIndicator>0</resendIndicator>
    </documentInfo>
    <sourceInfo>
    <sourceName>The Bank IFT</sourceName>
    <sourceID>
    <idOther>TheBankIFT</idOther>
    </sourceID>
    </sourceInfo>
    <destinationInfo>
    <destinationName>Test Company</destinationName>
    <destinationID>
    <idOther>FEI3592</idOther>
    </destinationID>
    </destinationInfo>
    </documentControlInfo>
    <checkItemCollection>
    <collectionInfo>
    <description>Items</description>
    <ID>1269994919135</ID>
    <Classification>
    <classification>Items</classification>
    </Classification>
    </collectionInfo>
    <checkItemBatch>
    <checkItemBatchInfo>
    <description>Paid Checks</description>
    <ID>1269994919135</ID>
    <Classification>
    <classification>Paid Checks</classification>
    </Classification>
    </checkItemBatchInfo>
    <checkItem>
    <checkItemType>check</checkItemType>
    <checkAmount>86468</checkAmount>
    <postingInfo>
    <date>2010-03-29</date>
    <RT>10700543</RT>
    <accountNumber>1234567890</accountNumber>
    <seqNum>009906631032</seqNum>
    <trancode>001051</trancode>
    <amount>86468</amount>
    <serialNumber>300040647</serialNumber>
    </postingInfo>
    <totalImageViewsDelivered>2</totalImageViewsDelivered>
    <imageView>
    <imageIndicator>Actual Item Image Present</imageIndicator>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Front</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003260000738400851844567205_Front.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Rear</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003260000738400851844567205_Rear.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    </imageView>
    </checkItem>
    <checkItem>
    <checkItemType>check</checkItemType>
    <checkAmount>045</checkAmount>
    <postingInfo>
    <date>2010-03-29</date>
    <RT>10700543</RT>
    <accountNumber>1234567890</accountNumber>
    <seqNum>008518967429</seqNum>
    <trancode>001051</trancode>
    <amount>045</amount>
    <serialNumber>200244935</serialNumber>
    </postingInfo>
    <totalImageViewsDelivered>2</totalImageViewsDelivered>
    <imageView>
    <imageIndicator>Actual Item Image Present</imageIndicator>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Front</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003290000713900851896742901_Front.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    <imageViewInfo>
    <Format>
    <Baseline>TIF</Baseline>
    </Format>
    <Compression>
    <Baseline>CCITT</Baseline>
    </Compression>
    <ViewSide>Rear</ViewSide>
    <imageViewLocator>
    <imageRefKey>201003290000713900851896742901_Rear.TIF</imageRefKey>
    <imageFileLocator>IFTDISB20100330172157M002.zip</imageFileLocator>
    </imageViewLocator>
    </imageViewInfo>
    </imageView>
    </checkItem>
    <checkItemBatchSummary>
    <totalItemCount>1028</totalItemCount>
    <totalBatchAmount>61370501</totalBatchAmount>
    <totalBatchImageViewsDelivered>2056</totalBatchImageViewsDelivered>
    </checkItemBatchSummary>
    </checkItemBatch>
    <collectionSummary>
    <totalBatchCount>1</totalBatchCount>
    <totalItemCount>1028</totalItemCount>
    <totalCollectionAmount>61370501</totalCollectionAmount>
    <totalCollectionImageViewsDelivered>2056</totalCollectionImageViewsDelivered>
    </collectionSummary>
    </checkItemCollection>
    <documentSummaryInfo>
    <totalCollectionCount>1</totalCollectionCount>
    <totalBatchCount>1</totalBatchCount>
    <totalItemCount>1028</totalItemCount>
    <totalDocumentAmount>61370501</totalDocumentAmount>
    <totalDocumentImageViewsDelivered>2056</totalDocumentImageViewsDelivered>
    </documentSummaryInfo>
    </bdiData>
    ++++++++++++++++++++++++++++++++++++++++++++++++
    Any ideas and or suggestions will be greatly appreciated.
    Cheers!
    Edited by: user12021655 on Aug 3, 2010 1:25 PM

    I really need to update my blog to get the example you are looking for posted. I did a quick search on the forums for XMLTable and found a good example at {message:id=4325701}. You will want to use OBJECT_VALUE in the PASSING clause where you need to reference the column in your table.
    Note: See the FAQ in the upper right for how to use the tag to wrap objects to retain formatting.  Also your XML is missing closing nodes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Loop Through Excel Files and Load into SQL Server Table

    I'm following the example here.
    https://www.youtube.com/watch?v=_B83CPqX-N4
    I'm pretty sure I did all the steps, but for some reason my project is not running.  I'm thinking there is a 32-bit or 64-bit issue lurking in here somewhere.
    Here's my error message.
    SSIS package "C:\Users\Ryan\Documents\Visual Studio 2010\Projects\Loop through Multiple Excel sheets and load them into a SQL Table\Integration Services Project1\Package.dtsx" starting.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Error: 0xC0209303 at Package, Connection manager "Excel Connection Manager": The requested OLE DB provider Microsoft.ACE.OLEDB.12.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.
    An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered".
    Error: 0xC001002B at Package, Connection manager "Excel Connection Manager": The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
    For more information, see http://go.microsoft.com/fwlink/?LinkId=219816
    Error: 0xC020801C at Data Flow Task, Excel Source [2]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. 
    There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error: 0xC0047017 at Data Flow Task, SSIS.Pipeline: Excel Source failed validation and returned error code 0xC020801C.
    Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.
    Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
    SSIS package "C:\Users\Ryan\Documents\Visual Studio 2010\Projects\Loop through Multiple Excel sheets and load them into a SQL Table\Integration Services Project1\Package.dtsx" finished: Failure.
    The program '[5392] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).
    I have 32-bit Excel and 64-bit SQL Server.  Is that the issue?  Can someone tell me what's wrong here?
    Thanks!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Sa-weeettttttt!!  Thanks.  I figured that's what it was.  For the benefit of others, this link shows you exactly how to make the modification recommended above.
    http://help.pragmaticworks.com/dtsxchange/scr/FAQ%20-%20How%20to%20run%20SSIS%20Packages%20using%2032bit%20drivers%20on%2064bit%20machine.htm
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to loop through Multiple Excel sheets and load them into a SQL Table?

    Hi ,
    I am having 1 excel sheet with 3 worksheet.
    I have configured using For each loop container and ADO.net rowset enumerator.
    Every thing is fine, but after running my package I am getting below error
    [Excel Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may
    be error messages posted before this with more information on why the AcquireConnection method call failed.
    Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified
    in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by
    another user, or you need permission to view and write its data.".
    Pleas suggest me the correct way of solving above issues.
    Thanks in advance :)
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi ,
    Please refer the below link for Looping multiple worksheet in a single SQL Table.
    http://www.singhvikash.in/2012/11/ssis-how-to-loop-through-multiple-excel.html
    Note:-If you using excel 2010 then you have to use EXCEL 12.0 .
    Above link explaining  step by step of Looping multiple worksheet in a single SQL Table.
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

  • 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

  • Error "Screen output are too small" when looping through internal table!

    Hello All:
         I have a huge internal table with some 79000 records and while looping through them and doing some other processing inside the loop, I am getting an error "Screen output are too small"! Could someone please help mw how to fix this issue? I can send the all the code if anyone wants to look at the code. Thanks in advance and rewards are assured.
    Mithun

    Hi,
    Check this
    new-page print off.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
    destination = v_dest
    IMPORTING
    out_parameters = params
    valid = valid.
    * params-linct = '58'.
    * params-linsz = '170'.
    * params-paart = 'X_58_170'.
    * params-prtxt = v_spool_text.
    * params-primm = 'X'.
    * params-prrel = 'X'.
    NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
    After the call fm GET_PRINT_PARAMETERS params internal table contains all the values for generating spool.
    aRs

  • Loop through a table

    Is it feasible to write code that loops through a table in a form? I'm currently writing separate sections of code for each row of a five-row table to validate data entries.

    Hi,
    It would be easier if your table contained one row that repeated with an initial count of five (this is set in the binding tab of the Object palette).  This will change the XML generated but assuming that is not a problem your could loop though your table with the code;
        var rows = this.resolveNodes("Table1.Row1[*]");
        for (var i=0; i<rows.length; i++)
            var currentRow = rows.item(i);
    If you do need the rows uniquely named then you could pass i and the result of "this.resolveNodes("Table1.Row"+i)" into a function.
    This is you form back ... with only the first validation converted to the new approach.
    https://acrobat.com/#d=akb0*Ptvdr3KSYN0VP*7zA
    Hope this gets you started.
    Regards
    Bruce

  • I need to loop through 1 table and read another until a value changes

    i need to read a table and sum the quantity field until a reason code changes.  how do I go about doing this?

    sort itab by reasoncode.
    Loop at itab.
    quantiy = quanity  + itab-quantity.
    at end of reasoncode.
    jtab-reasoncode = itab-reasoncodee.
    jtab-sum = quantity.
    append jtab.
    clear quantity.
    endat
    endloop.
    or
    sort itab  by reasoncode.
    loop at itab.
    at end of reasoncode.
    sum.
    jtab = itab.
    append jtab.
    endat.
    endloop.
    or
    let us say itab and jtab are two tables and you want to loop through itab and read jtab for reasoncodes.
    if jtab has only one entry for each entry in itab then use read else use loop.
    loop at itab.
    loop at jtab where reasoncode = itab-reasoncode.
    quantiy = quantiy + jtab-quanity.
    endloop.
    endloop.
    or
    loop at itab.
    read table jtab with key reasoncode = itab-reasoncode.
    if sy-subrc eq 0.
    endif
    endloop.

Maybe you are looking for

  • Issue with Graphic Adapter on a T400 model 6475-CA6 - BSOD daily few times

    From the many T400's we have installed there are a few which cause blue screens while working. To us it seems something to do with the graphic adapter or driver or ?? Anyway, when we disable the power saving features to issue is gone..no matter how h

  • Why is my CWButton LED switch from 3D Stye to Classic (saving or running?)

    I was adding a LED to my Visual Basic form, and I switch the CWButton to a 3D Style LED. When I run the program the form shows it as a classic style. I convert it back to 3D.. then just save the form, it converts it back to classic style. I want to k

  • Problems with the System.Windows.Forms.Timer

    Hi All, Could some one help me please? I'm having a problem using the System.Windows.Forms.Timer inside an ItemEvent, the timer event just doesn't works...give a look in my code: private System.Windows.Forms.Timer myTimer = new System.Windows.Forms.T

  • Lion Mail Yahoo IMAP Sync Inconsistent

    Observed behavior: Mail is syncing with Yahoo IMAP every five minutes, but when I delete or mark messages as read from the Yahoo website, iPhone or any other device, the Mail app will not reflect these changes even after the auto or manul sync. In or

  • How can I turn off upgrade/update to Yosemite?

    Having tried the Yosemite Beta, I've decided to stay with Mavericks for a while. How can I turn off the notification / blandishment / request asking me to  upgrade / update to Yosemite so I don't inadvertently wipe out the hours & hours of effort it'