Help need for PL/SQL procedure

Hi guys,
I have scenario like this
Schema     T     LOGTABLENAME          TDIRECTORY
DEV          DEV.ABC_LOG                    import-abc
DEV          DEV.GBTSLOG          import-gbts
DEV          DEV.CLSSBOG     import-cls
QA          QA.TransactionlOG          import-transaction
QA1 QA1.tlog import-ess
QA2 QA2.translog import-trnals
I have to write a procedure to get the log table data from schema Dev.I have to take Shcema dev and go to DEv.abc_log table and get the record from the dev.abc_logtable. The same way for other schema also with respective logtables .
I would appreciate your help or suggestions.
Reards,
User
Edited by: user1758353 on Dec 5, 2008 11:43 AM

hello,
im also not sure if i get the point but maybe you need sth. like that...
create table schema_logtable as
select 'dev' schema, 'dev.abc_log' tlogtable, 'import-abc' tdirectory from dual union all
select 'dev', 'dev.gbtslog', 'import-gpts' from dual union all
select 'dev', 'dev.clssbog', 'import-cls' from dual );
declare
   v_slt_row schema_logtable%rowtype;
   type log_description_table is table of varchar2(1000char);
   v_log_description log_description_table := log_description_table();
begin
   for v_slt_row in ( select * from schema_logtable )
   loop
      execute immediate 'select log_description from ' || v_slt_row.tlogtable bulk collect into v_log_description;
      for i in v_log_description.first .. v_log_description.last
      loop
         dbms_output.put_Line( 'log_desc: ' || v_log_description(i) );
      end loop;
   end loop;
end;
/this reads for every schema in table schema_logtable the name of the logtable.
for each logtable you fetch all rows of that table into a variable and you can do what-ever you want with that...
-mario

Similar Messages

  • Help need  for  PL/SQL  collections

    Hi All,
    Please help me to solve the following Error.
    Error # ORA-06533: Subscript beyond count.
    I am using Oracle 10g.
    I have data in the Test_table
    id_col stat_col reason_col
    101 A          HPQ
    101 A NULL
    101 NULL EDU
    101 P NULL
    102 P NULL
    102 NULL HEN
    103 R NULL
    103 Q NULL
    Ny requirement is like:
    id_col stat_col_ reason_col
    101 A|P HPQ|EDU
    102 P HEN
    103 R|Q NULL
    step1- Type tab_type as table of varchar2(32767);
    step2 - I have written a function which returns the pl/sql table type
    create or replace function fn_get_val(id in VARCHAR2)
    return tab_type
    cursor my_cur is
    select id_col,stat_col,reason_col
    from test_table WHERE ID_COL = ID;
    lv_status VARCHAR2(100);
    LV_reason varchar2(200);
    lv_sep CHAR(1);
    lv_disp_stat varchar2(200);
    lv_disp_reason varchar2(200);
    LN_STR NUMBER;
    BEGIN
    lv_tab_data:= tab_type();
    lv_tab_data.extend;
    open my_cur;
    loop
    fetch my_cur into lv_status,lv_reason;
    exit when my_cur%notfound;
    --dbms_output.put_line('my_curr.rowcount'|| my_curr.rowcount);
    lv_disp_stat:= lv_disp_stat||lv_sep||lv_status;
    lv_disp_reason:= lv_disp_reason||lv_sep||lv_reason;
    lv_sep:= '|';
    end loop;
    -- To remove first occurance of (|) pipeline in the string.
    LN_STR := INSTR(lv_str1,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_stat := SUBSTR(lv_disp_stat ,2 );
    END IF;
    LN_STR := INSTR(lv_str2,'|',1,1);
    IF LN_STR = 1 THEN
    lv_disp_reason := SUBSTR(lv_disp_reason ,2 );
    END IF;
    lv_tab_data(1) := lv_disp_stat;
    lv_tab_data.extend;
    lv_tab_data(2) := lv_disp_reason;
    return lv_tab_data;
    EXCEPTION
    DBMS_OUTPUT.PUT_LINE('Error in function fn_get_val # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END fn_get_val;
    STEP-3
    I have created one procedure where the above function is called
    CREATE OR REPLACE PROCEDURE my_proc (p_emp_id in Varchar2)
    AS
    lv_tab_ty tab_type;
    CURSOR DET_CUR IS
    SELECT EMP_ID_C,NAME_C,LOCATION
    FROM DETAILS_TABLE
    WHERE EMP_ID_C = p_emp_id;
    type det_tab_ty is table of det_cur%type index by pls_integer;
    lv_det_rec det_tab_ty;
    BEGIN
         lv_tab_ty := fn_get_val(p_emp_id);
         dbms_output.put_line('lv_tab_ty.count is : '||lv_tab_ty.count);
         OPEN DET_CUR;
         LOOP
         FETCH DET_CUR BULK COLLECT INTO lv_det_rec;
         EXIT WHEN DET_CUR%NOTFOUND;
         END LOOP;
         CLOSE DET_CUR;
         IF lv_det_rec.COUNT > 0 THEN
         FOR i IN lv_det_rec.FIRST .. lv_det_rec.LAST
         LOOP
         INSERT INTO other_tab (emp_id_c,name_c,Loc_c,status_c,reason_c) values(lv_det_rec(i).emp_id_c,lv_det_rec(i).NAME_C,lv_det_rec(i).LOCATION,lv_tab_ty(1),lv_tab_ty(2) );
         END LOOP;
         END IF;
    COMMIT;
    EXCEPTIONS
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error in procedure my_proc # '||SQLERRM||' - '||dbms_utility.format_error_backtrace);
    END my_proc ;
    After exucting the above procedure i am getting the following error.
    lv_tab_ty.count is : 1
    Error # ORA-06533: Subscript beyond count.
    This error is occured when my_curr.rowcount is equal to 0 (cursor defined in the function fn_get_val() ).
    The function fn_get_val() does return null to the pl/sql table variable (lv_tab_ty).
    AND another schenario:
    If
    lv_tab_data.count = 1
    Then how can i handle this situation in the above procedure,because i need both
    lv_tab_data(1)
    and lv_tab_data(2)
    to insert to the OTHER_TABLE in the procedure.
    Please help me to solve this issue.
    Thanks in Advance!!!
    PKM

    You can do it with one query with Tom Kyte's stragg function:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3431223221768118::::P11_QUESTION_ID:15637744429336
    with test_table(id_col,stat_col,reason_col) as (
    select 101,'A','PQ' from dual union all
    select 101,'A',NULL from dual union all
    select 101,NULL,'EDU' from dual union all
    select 101,'P',NULL from dual union all
    select 102,'P',NULL from dual union all
    select 102,NULL,'HEN' from dual union all
    select 103,'R',NULL from dual union all
    select 103,'Q',NULL from dual
    select id_col,replace(stragg(stat_col),',','|'),replace(stragg(reason_col),',','|')
    from test_table tt
    group by id_colRegards,
    Sayan M.

  • Help needed for SCCM SQL query

    Hello.
    I have the below query to extract the workstations build date as well as the hardware info. This works fine. 
    Select distinct
    v_R_System.Name0,
    v_GS_COMPUTER_SYSTEM.Manufacturer0,
    v_GS_COMPUTER_SYSTEM.Model0,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
    v_GS_OPERATING_SYSTEM.Caption0,
    v_GS_OPERATING_SYSTEM.CSDVersion0,
    v_GS_OPERATING_SYSTEM.InstallDate0
    From v_R_System
    LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM ON v_GS_COMPUTER_SYSTEM.ResourceID=v_R_System.ResourceID
    LEFT JOIN v_GS_SYSTEM_CONSOLE_USAGE ON v_R_System.ResourceID=v_GS_SYSTEM_CONSOLE_USAGE.ResourceID
    Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' and v_R_System.Is_Virtual_Machine0 =0
    order by v_GS_OPERATING_SYSTEM.InstallDate0 desc
    Now, I want a report of count of machines built based on "v_GS_COMPUTER_SYSTEM_PRODUCT.Version0" against every month and year of "v_GS_OPERATING_SYSTEM.InstallDate0".
    For example, I want to know the number of machines under a particular model (which appears under  v_GS_COMPUTER_SYSTEM_PRODUCT.Version0) built in June 2014. In this fashion I want a report for every model count for every month and year available under
    InstallDate0 column)
    Example:
    Jan 2013 ->  ThinkCentre M92p -> 55
    Jan 2013 ->  ThinkCentre M93 -> 40
    Feb 2013 ->  ThinkCentre M92p -> 10
    Feb 2013 ->  ThinkCentre M93 -> 39
    Jan 2014 ->  ThinkCentre M92p -> 20
    Jan 2014 ->  ThinkCentre M93 -> 25
    Feb 2014 ->  ThinkCentre M92p -> 12
    Feb 2014 ->  ThinkCentre M93 -> 35
    Can anyone help?

    After scratching my head a bit, I came up with the below. Do you find any flaw in it?
    Select
    v_GS_COMPUTER_SYSTEM.Manufacturer0 as Manufacturer,
    v_GS_COMPUTER_SYSTEM.Model0 as Model,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 as "Model Info",
    COUNT(*) as "No. of machines built",
    CASE WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '1' THEN 'January'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '2' THEN 'February'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '3' THEN 'March'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '4' THEN 'April'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '5' THEN 'May'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '6' THEN 'June'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '7' THEN 'July'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '8' THEN 'August'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '9' THEN 'September'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '10' THEN 'October'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '11' THEN 'November'
    WHEN Month(v_GS_OPERATING_SYSTEM.InstallDate0) = '12' THEN 'December'END as "Month",
    YEAR(v_GS_OPERATING_SYSTEM.InstallDate0) as "Year"
    From v_GS_COMPUTER_SYSTEM
    LEFT JOIN v_GS_OPERATING_SYSTEM ON v_GS_OPERATING_SYSTEM.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
    LEFT JOIN v_GS_COMPUTER_SYSTEM_PRODUCT ON v_GS_COMPUTER_SYSTEM_PRODUCT.ResourceID=v_GS_COMPUTER_SYSTEM.ResourceID
    Where v_GS_OPERATING_SYSTEM.Caption0 = 'Microsoft Windows 7 Enterprise' Group By v_GS_COMPUTER_SYSTEM.Manufacturer0,
    v_GS_COMPUTER_SYSTEM.Model0,
    v_GS_COMPUTER_SYSTEM_PRODUCT.Version0,
    Month(v_GS_OPERATING_SYSTEM.InstallDate0),
    YEAR(v_GS_OPERATING_SYSTEM.InstallDate0)
    Order by v_GS_COMPUTER_SYSTEM_PRODUCT.Version0 desc

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with re

    Color management help needed for adobe CS5 and Epson printer 1400-Prints coming out too dark with reddish cast and loss of detail
    System: Windows 7
    Adobe CS5
    Printer: Epson Stylus Photo 1400
    Paper: Inkjet matte presentation paper with slight luster
    Installed latest patch for Adobe CS5
    Epson driver up to date
    After reading solutions online and trying them for my settings for 2 days I am still unable to print what I am seeing on my screen in Adobe CS5. I calibrated my monitor, but am not sure once calibration is saved if I somehow use this setting in Photoshop’s color management.
    The files I am printing are photographs of dogs with lots of detail  I digitally painted with my Wacom tablet in Photoshop CS5 and then printed with Epson Stylus 1400 on inkjet paper 20lb with slight luster.
    My Printed images lose a lot of the detail & come out way to dark with a reddish cast and loss of detail when I used these settings in the printing window:
    Color Handling: Photoshop manages color, Color management -ICM, OFF no color adjustment.
    When I change to these settings in printer window: Color Handling:  Printer manages color.  Color management- Color Controls, 1.8 Gamma and choose Epson Standard it prints lighter, but with reddish cast and very little detail and this is the best setting I have used so far.
    Based on what I have read on line, I think the issue is mainly to do with what controls are set in the Photoshop Color Settings window and the Epson Printer preferences. I have screen images attached of these windows and would appreciate knowing what you recommend I enter for each choice.
    Also I am confused as to what ICM color management system to use with this printer and CS5:
    What is the best ICM to use with PS CS5 & the Epson 1400 printer? Should I use the same ICM for both?
    Do I embed the ICM I choose into the new files I create? 
    Do I view all files in the CS5 workspace in this default ICM?
    Do I set my monitor setting to the same ICM?
    If new file opens in CS5 workspace and it has a different embedded profile than my workspace, do I convert it?
    Do I set my printer, Monitor and PS CS5 color settings to the same ICM?
    Is using the same ICM for all devices what is called a consistent workflow?
    I appreciate any and all advice that can be sent my way on this complicated issue. Thank you in advance for your time and kind help.

    It may be possible to figure out by watching a Dr.Brown video on the subject of color printing. Adobe tv
    I hope this may help...............

  • File missing (file\BCD error code 0Xc0000034 help need for work!

    file missing (file\BCD  error code 0Xc0000034 help need for work!    what can i do?
    have an p 2000 notebook pc

     Hi bobkunkle, welcome to the HP Forums. I understand you cannot boot passed the error you are receiving.
    What is the model or product number of your notebook? What version of Windows is installed?
    Guide to finding your product number
    Which Windows operating system am I running?
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • Make EXE for Pl/sql procedure

    Hi all,
    I have one Pl/sql procedure for which i want make EXE.
    can we make EXE files for PL/sql procedures using ' Oracle Developer Tools for Visual Studio .NET'
    Thank you.

    Hi Al,
    Can you tell me in steps how to create EXE for pl/sql procedure using C# console application.
    I have one webservice link which i want to invoke and i have to put the webservice output in a saparate file.
    I wrote Pl/sql procedure which invokes/consumes the webservice using UTL_HTTP and also placed the output of Webservice in a saparate file using UTL_FILE.
    But i have to execute this procedure on a Workstation where there is No Oracle installed.
    as you suggested using C# console application. Will this Procedure with UTL_FILE & UTL_HTTP packages run in that c# console application.
    Thank you

  • Help need for force to signout All session ! how...

    hi
         help need for force to  signout All session !  how ??
    Solved!
    Go to Solution.

    Hi and welcome to the Skype Community,
    To force a signout of all instances your Skype is signed into please change your password: https://support.skype.com/en/faq/FA95/how-do-i-change-my-password
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • Pagination query help needed for large table - force a different index

    I'm using a slight modification of the pagination query from over at Ask Tom's: [http://www.oracle.com/technology/oramag/oracle/07-jan/o17asktom.html]
    Mine looks like this when fetching the first 100 rows of all members with last name Smith, ordered by join date:
    SELECT members.*
    FROM members,
        SELECT RID, rownum rnum
        FROM
            SELECT rowid as RID
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
             and RID = members.rowidThe difference between this and the one at Ask Tom's is that my innermost query just returns the ROWID. Then in the outermost query we join the ROWIDs returned to the members table, after we have pruned the ROWIDs down to only the chunk of 100 we want. This makes it MUCH faster (verifiably) on our large tables, as it is able to use the index on the innermost query (well... read on).
    The problem I have is this:
    SELECT rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateThis will use the index for the predicate column (last_name) instead of the unique index I have defined for the joindate column (joindate, sequence). (Verifiable with explain plan). It is much slower this way on a large table. So I can hint it using either of the following methods:
    SELECT /*+ index(members, joindate_idx) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindate
    SELECT /*+ first_rows(100) */ rowid as RID
    FROM members
    WHERE last_name = 'Smith'
    ORDER BY joindateEither way, it now uses the index of the ORDER BY column (joindate_idx), so now it is much faster as it does not have to do a sort (remember, VERY large table, millions of records). So that seems good. But now, on my outermost query, I join the rowid with the meaningful columns of data from the members table, as commented below:
    SELECT members.*      -- Select all data from members table
    FROM members,           -- members table added to FROM clause
        SELECT RID, rownum rnum
        FROM
            SELECT /*+ index(members, joindate_idx) */ rowid as RID   -- Hint is ignored now that I am joining in the outer query
            FROM members
            WHERE last_name = 'Smith'
            ORDER BY joindate
        WHERE rownum <= 100
    WHERE rnum >= 1
            and RID = members.rowid           -- Merge the members table on the rowid we pulled from the inner queriesOnce I do this join, it goes back to using the predicate index (last_name) and has to perform the sort once it finds all matching values (which can be a lot in this table, there is high cardinality on some columns).
    So my question is, in the full query above, is there any way I can get it to use the ORDER BY column for indexing to prevent it from having to do a sort? The join is what causes it to revert back to using the predicate index, even with hints. Remove the join and just return the ROWIDs for those 100 records and it flies, even on 10 million records.
    It'd be great if there was some generic hint that could accomplish this, such that if we change the table/columns/indexes, we don't need to change the hint (the FIRST_ROWS hint is a good example of this, while the INDEX hint is the opposite), but any help would be appreciated. I can provide explain plans for any of the above if needed.
    Thanks!

    Lakmal Rajapakse wrote:
    OK here is an example to illustrate the advantage:
    SQL> set autot traceonly
    SQL> select * from (
    2  select a.*, rownum x  from
    3  (
    4  select a.* from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  )
    9  where x >= 1100
    10  /
    101 rows selected.
    Execution Plan
    Plan hash value: 3711662397
    | Id  | Operation                      | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  1 |  VIEW                          |            |  1200 |   521K|   192   (0)| 00:00:03 |
    |*  2 |   COUNT STOPKEY                |            |       |       |            |          |
    |   3 |    VIEW                        |            |  1200 |   506K|   192   (0)| 00:00:03 |
    |   4 |     TABLE ACCESS BY INDEX ROWID| EVENTS     |   253M|    34G|   192   (0)| 00:00:03 |
    |   5 |      INDEX FULL SCAN           | EVEN_IDX02 |  1200 |       |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("X">=1100)
    2 - filter(ROWNUM<=1200)
    Statistics
    0  recursive calls
    0  db block gets
    443  consistent gets
    0  physical reads
    0  redo size
    25203  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    SQL>
    SQL>
    SQL> select * from aoswf.events a, (
    2  select rid, rownum x  from
    3  (
    4  select rowid rid from aoswf.events a
    5  order by EVENT_DATETIME
    6  ) a
    7  where rownum <= 1200
    8  ) b
    9  where x >= 1100
    10  and a.rowid = rid
    11  /
    101 rows selected.
    Execution Plan
    Plan hash value: 2308864810
    | Id  | Operation                   | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |   1 |  NESTED LOOPS               |            |  1200 |   201K|   261K  (1)| 00:52:21 |
    |*  2 |   VIEW                      |            |  1200 | 30000 |   260K  (1)| 00:52:06 |
    |*  3 |    COUNT STOPKEY            |            |       |       |            |          |
    |   4 |     VIEW                    |            |   253M|  2895M|   260K  (1)| 00:52:06 |
    |   5 |      INDEX FULL SCAN        | EVEN_IDX02 |   253M|  4826M|   260K  (1)| 00:52:06 |
    |   6 |   TABLE ACCESS BY USER ROWID| EVENTS     |     1 |   147 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("X">=1100)
    3 - filter(ROWNUM<=1200)
    Statistics
    8  recursive calls
    0  db block gets
    117  consistent gets
    0  physical reads
    0  redo size
    27539  bytes sent via SQL*Net to client
    281  bytes received via SQL*Net from client
    8  SQL*Net roundtrips to/from client
    0  sorts (memory)
    0  sorts (disk)
    101  rows processed
    Lakmal (and OP),
    Not sure what advantage you are trying to show here. But considering that we are talking about pagination query here and order of records is important, your 2 queries will not always generate output in same order. Here is the test case:
    SQL> select * from v$version ;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> show parameter optimizer
    NAME                                 TYPE        VALUE
    optimizer_dynamic_sampling           integer     2
    optimizer_features_enable            string      10.2.0.1
    optimizer_index_caching              integer     0
    optimizer_index_cost_adj             integer     100
    optimizer_mode                       string      ALL_ROWS
    optimizer_secure_view_merging        boolean     TRUE
    SQL> show parameter pga
    NAME                                 TYPE        VALUE
    pga_aggregate_target                 big integer 103M
    SQL> create table t nologging as select * from all_objects where 1 = 2 ;
    Table created.
    SQL> create index t_idx on t(last_ddl_time) nologging ;
    Index created.
    SQL> insert /*+ APPEND */ into t (owner, object_name, object_id, created, last_ddl_time) select owner, object_name, object_id, created, sysdate - dbms_random.value(1, 100) from all_objects order by dbms_random.random;
    40617 rows created.
    SQL> commit ;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(user, 'T', cascade=>true);
    PL/SQL procedure successfully completed.
    SQL> select object_id, object_name, created from t, (select rid, rownum rn from (select rowid rid from t order by created desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    CREATED
         47686 ALL$OLAP2_JOIN_KEY_COLUMN_USES 28-JUL-2009 08:08:39
         47672 ALL$OLAP2_CUBE_DIM_USES        28-JUL-2009 08:08:39
         47681 ALL$OLAP2_CUBE_MEASURE_MAPS    28-JUL-2009 08:08:39
         47682 ALL$OLAP2_FACT_LEVEL_USES      28-JUL-2009 08:08:39
         47685 ALL$OLAP2_AGGREGATION_USES     28-JUL-2009 08:08:39
         47692 ALL$OLAP2_CATALOGS             28-JUL-2009 08:08:39
         47665 ALL$OLAPMR_FACTTBLKEYMAPS      28-JUL-2009 08:08:39
         47688 ALL$OLAP2_DIM_LEVEL_ATTR_MAPS  28-JUL-2009 08:08:39
         47689 ALL$OLAP2_DIM_LEVELS_KEYMAPS   28-JUL-2009 08:08:39
         47669 ALL$OLAP9I2_HIER_DIMENSIONS    28-JUL-2009 08:08:39
         47666 ALL$OLAP9I1_HIER_DIMENSIONS    28-JUL-2009 08:08:39
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc ;
    OBJECT_ID OBJECT_NAME                    LAST_DDL_TIME
         37534 com/sun/mail/smtp/SMTPMessage  06-FEB-2010 03:46:14
         13133 oracle/jdbc/driver/OracleLog$3 06-FEB-2010 03:45:44
         11749 /b9fe5b99_OraRTStatementComman 06-FEB-2010 03:43:49
         42266 SI_GETCLRHSTGRFTR              06-FEB-2010 03:40:20
         16695 /2940a364_RepIdDelegator_1_3   06-FEB-2010 03:38:17
         36539 sun/io/ByteToCharMacHebrew     06-FEB-2010 03:28:57
         26815 /7a628fb8_DefaultHSBChooserPan 06-FEB-2010 03:26:55
         14044 /d29b81e1_OldHeaders           06-FEB-2010 03:12:12
         36145 /4e492b6f_SerProfileToClassErr 06-FEB-2010 03:11:09
         12920 /25f8f3a5_BasicSplitPaneUI     06-FEB-2010 03:11:06
         15752 /2f494dce_JDWPThreadReference  06-FEB-2010 03:09:31
    11 rows selected.
    SQL> set autotrace traceonly
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid order by last_ddl_time desc
      2  ;
    11 rows selected.
    Execution Plan
    Plan hash value: 44968669
    | Id  | Operation                       | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |   1 |  SORT ORDER BY                  |       |  1200 | 91200 |   180   (2)| 00:00:03 |
    |*  2 |   HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  3 |    VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  4 |     COUNT STOPKEY               |       |       |       |            |          |
    |   5 |      VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   6 |       INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   7 |    TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("T".ROWID="T1"."RID")
       3 - filter("RN">=1190)
       4 - filter(ROWNUM<=1200)
    Statistics
              1  recursive calls
              0  db block gets
            348  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT         |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                    |      |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY          |      |       |       |            |          |
    |   3 |    VIEW                  |      | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|      | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL   | T    | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            343  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from t, (select rid, rownum rn from (select rowid rid from t order by last_ddl_time desc) where rownum <= 1200) t1 where rn >= 1190 and t.rowid = t1.rid ;
    11 rows selected.
    Execution Plan
    Plan hash value: 168880862
    | Id  | Operation                      | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT               |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  1 |  HASH JOIN                     |       |  1200 | 91200 |   179   (2)| 00:00:03 |
    |*  2 |   VIEW                         |       |  1200 | 30000 |    98   (0)| 00:00:02 |
    |*  3 |    COUNT STOPKEY               |       |       |       |            |          |
    |   4 |     VIEW                       |       | 40617 |   475K|    98   (0)| 00:00:02 |
    |   5 |      INDEX FULL SCAN DESCENDING| T_IDX | 40617 |   793K|    98   (0)| 00:00:02 |
    |   6 |   TABLE ACCESS FULL            | T     | 40617 |  2022K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("T".ROWID="T1"."RID")
       2 - filter("RN">=1190)
       3 - filter(ROWNUM<=1200)
    Statistics
              0  recursive calls
              0  db block gets
            349  consistent gets
              0  physical reads
              0  redo size
           1063  bytes sent via SQL*Net to client
            385  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             11  rows processed
    SQL> select object_id, object_name, last_ddl_time from (select t1.*, rownum rn from (select * from t order by last_ddl_time desc) t1 where rownum <= 1200) where rn >= 1190 order by last_ddl_time desc ;
    11 rows selected.
    Execution Plan
    Plan hash value: 882605040
    | Id  | Operation           | Name | Rows     | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  1 |  VIEW                |     |  1200 | 62400 |    80   (2)| 00:00:01 |
    |*  2 |   COUNT STOPKEY       |     |     |     |          |          |
    |   3 |    VIEW            |     | 40617 |  1546K|    80   (2)| 00:00:01 |
    |*  4 |     SORT ORDER BY STOPKEY|     | 40617 |  2062K|    80   (2)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL      | T     | 40617 |  2062K|    80   (2)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("RN">=1190)
       2 - filter(ROWNUM<=1200)
       4 - filter(ROWNUM<=1200)
    Statistics
         175  recursive calls
           0  db block gets
         388  consistent gets
           0  physical reads
           0  redo size
           1063  bytes sent via SQL*Net to client
         385  bytes received via SQL*Net from client
           2  SQL*Net roundtrips to/from client
           4  sorts (memory)
           0  sorts (disk)
          11  rows processed
    SQL> set autotrace off
    SQL> spool offAs you will see, the join query here has to have an ORDER BY clause at the end to ensure that records are correctly sorted. You can not rely on optimizer choosing NESTED LOOP join method and, as above example shows, when optimizer chooses HASH JOIN, oracle is free to return rows in no particular order.
    The query that does not involve join always returns rows in the desired order. Adding an ORDER BY does add a step in the plan for the query using join but does not affect the other query.

  • Urgent help needed for XML Tags using XMLForest()

    Folks
    I need some urgent help regarding getting use defined tag in your
    XML output.
    For this I am using XMLElement and XMLForest which seems to work fine
    when used at the SQL prompt but when used in a procedure throws and error
    SQL> Select SYS_XMLAGG(XMLElement("SDI",
                                       XMLForest(sdi_num)))
         From sdi
         where sdi_num = 22261;- WORKS FINE
    But when used in a procedure,doesnt seem to work
    Declare
        queryCtx  DBMS_XMLQuery.ctxType;
        v_xml     VARCHAR2(32767);
        v_xmlClob CLOB;
        BEGIN
        v_xml:='Select SYS_XMLAGG(XMLElement("SDI",
                                             XMLFOREST(sdi_num)))
        From sdi
        where sdi_num = 22261';
        queryCtx :=DBMS_XMLQuery.newContext(v_xml);
        v_xmlClob :=DBMS_XMLQuery.getXML(queryCtx);
        display_xml(v_xmlClob);
    End;
    CREATE OR REPLACE PROCEDURE  display_xml(result IN OUT NOCOPY CLOB)
    AS
         xmlstr varchar2(32767);
         line varchar2(2000);
    BEGIN
         xmlstr:=dbms_lob.SUBSTR(result,32767);
         LOOP
         EXIT WHEN xmlstr is null;
         line :=substr(xmlstr,1,instr(xmlstr,chr(10))-1);
         dbms_output.put_line('.'||line);
         xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
         END LOOP;
    end;
    SQL> /
    .<?xml version = '1.0'?>
    .<ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an
    XML tag name.</ERROR>
    PL/SQL procedure successfully completed.
    SQL>HELP is appreciated as to where I am going wrong?

    Hi,
    if you want to transform something to something else, you should declare, what is your source.
    I would prefer to use plain XSL-Transformations, because you have a lot more options to transform your source and you can even better determine, how your output should looks like.
    Kind regards,
    Hendrik

  • Help needed to create a Procedure

    Can anyone help me with a small procedure I have to write?
    Requirement to create Stored Procedure :
    1.  Create tables
         A1
         A2
         B1
         B2
    ----------- this is done------
    Fill the data in those tables
    ------------this is also done----
    Create "Source_table.tx"t file with table names and place them in any location.
    ------------this is also done----
    write a procedure to read the above file "Source_table.txt"  and it should read the tables name 1 by 1 which performs a simple operation inside SP -->  
    Select * from @Table_Name
    Also, it should check if the .txt file is exisiting or not.
    If exists then Read the file and execute the SP.
          SP does this :
             Select * from A1
             Select * from A2
             Select * from B1
             Select * from B2
    After that, write an output file with the counts of records to the same location  where our Source_table.txt exists .
    If doesnt exist then write to a .txt file that "File name and Location doesnt exist"

    What format is the data inside your .txt file?
    If it's just some lines containing the names of the tables then you may as well just use the UTL_FILE package to:
    a) check the existence of the file using the UTL_FILE.FGETATTR procedure
    b) open and read the contents of the file using the UTL_FILE.FOPEN, UTL_FILE.GET_LINE and UTL_FILE.FCLOSE functions/procedures.
    UTL_FILE
    Alternatively you could set up an external table to read the .txt file as though it's a table.
    Managing External Tables
    Once you extract the table names from the .txt file, you'll then have to construct dynamic SQL queries to query the data from them.  Are all of the tables of the same structure or do they change?  If they change you'll have to use the DBMS_SQL package.  If they don't you could do it more statically in PL/SQL code (at least in terms of the structures you're reading the data into), but you may still be better using DBMS_SQL for it.  It depends what you're trying to do exactly and why these table names are being exported to a file and need to be read dynamically in this way.  Often Dynamic coding indicates poor design, but without knowing exactly what you're doing, it's hard to tell if it's really necessary or not.

  • TTClasses interface for PL/SQL procedure and fetching its results

    Hi experts,
    I am using TimesTen Release 11.2.1.3.0;
    I created a simple PL/SQL procedure as follows in timesten-
    Command> create or replace procedure employee(eno in emp.empno%type) is
    > e_name emp.ename%type;
    > begin
    > select ename into e_name from emp where emp.empno = eno;
    > dbms_output.put_line(e_name);
    > end;
    > /
    And then I call it through TTClasses as
    TTCmd cmd, compilecmd;
    compilecmd.Prepare(conn,"alter procedure employee compile;",status);
    cmd.Prepare(conn,"begin employee(1020); end;",status);
    cmd.Execute(..);
    cmd.FetchNext(..);
    Here fetchNext is returning an error -
    [TimesTen][TimesTen 11.2.1.3.0 ODBC Driver]Invalid cursor state
    *** ODBC Error/Warning = 24000, TimesTen Error/Warning = 0
    *** Unable to fetch row for statement: <begin employee(1020); end;>.terminate called after throwing an instance of 'TTError'
    Aborted
    How can I run PL/SQL procedures/functions on TimesTen through TTClasses interface?
    Any help or input would be of great value.
    Thanks

    The issue here is nothing to do with TTClasses. Your PL/SQL procedure executes a SELECT statement (that returns just one row) using an implicit cursor within the PL/SQL procedure and retrieves the value of the ename column into the PL/SQL variable. However it does not them do anything with that value such as pass it back to the caller...
    Similarly, the TTClasses code executes a statement that it is expecting to create an ODBC level cursor 9which thsi PL/SQL invocation will not of course) and it is then trying to fetch from a cursor that does not exist.
    I would recommend that you take a look at the TimesTen PL/SQL documentation (Oracle® TimesTen In-Memory Database PL/SQL Developer's Guide Release 11.2.1) and refer to the section on IN, OUT and IN/OUT parameters. This will show you how you can use OUT parameters to return values to the caller. This technique works fine for ODBC, JDBC and OCi programs but does not sadly currently work with TTClasses. TTClasses has not yet been enhanced to support OUT and INOUT parameters. Of course as you have the source code for TTClasses you could make the necessary modifications yourself.
    I will open a bug requesting that TTClasses support OUT and INOUT parameters but in the meantime if you need this kind of capability you will need to either modify TTClasses yourself or switch to using a different API.
    Chris

  • Advice needed for pl/sql

    Hey guys,
    I am look out for book/ articles for learning pl/sql . I am new to pl/sql adn i want book/ articles that help me learn pl/sql from scratch. I have see many books oriented towards DBA. I dont want such type of books. Please let me know the books/ articles that beginner needs, preferably artcles// books with lot of developer examples. ALso let me know any books/artciles to learn forms, reports.
    Please advice me on this.
    The response will be highly appreciated.
    Thanks
    u can mail me at : [email protected]

    It depends what you mean when you call yourself 'new'. There are two main concepts to learn for pl/sql: the sql language, and procedural logic. If you have previously been a programmer in any 3GL, you will be familiar with the procedural part, which is pretty much the same principal in any programming language. If you have no experience with sql, you really need to become proficient with that, otherwise there is a danger of writing everything procedurally when you should be doing it with sql.
    I find the Steven Feuerstein book very good, combined with Oracle manuals.

  • Help needed In testing a procedure

    Hi,
    This Is My procedure. I need to test this procedure. How can i pass multiple values to this first two parameters and check ?
    CREATE OR REPLACE PROCEDURE testts (
    i_custid IN str_varray,
    i_pymtref IN str_varray,
    i_screen IN VARCHAR2,
    i_rejreason IN VARCHAR2,
    i_userid IN tl_pymt_details.user_id%TYPE,
    i_country_code IN tl_pymt_details.country_code%TYPE,
    i_city_code IN tl_pymt_details.city_code%TYPE,
    o_intrc OUT NUMBER
    IS
    w_intrc NUMBER;
    w_excep EXCEPTION;
    w_time_zone_date TIMESTAMP ( 6 );
    w_custid tl_pymt_details.cust_id%TYPE;
    w_pymtref tl_pymt_details.pymt_ref%TYPE;
    BEGIN
    IF i_screen = 'confirm'
    THEN
    FOR i IN 1 .. i_custid.COUNT
    LOOP
    w_custid := i_custid (i);
    w_pymtref := i_pymtref (i);
    sp_031_process_time_zone_diff (w_time_zone_date);
    UPDATE tl_pymt_details
    SET status_code = 151
    WHERE cust_id = i_custid (i) AND pymt_ref = i_pymtref (i);
    INSERT INTO tl_pymt_details_trk
    (cust_id, pymt_ref, modi_date, status_code,
    payee_charge_status, modi_by, country_code, city_code)
    (SELECT cust_id, pymt_ref, w_time_zone_date, status_code,
    payee_charge_status, i_userid, pd.country_code,
    pd.city_code
    FROM tl_pymt_details pd, tl_sys_parm sp
    WHERE cust_id = i_custid (i)
    AND pymt_ref = i_pymtref (i)
    AND pd.country_code = i_country_code
    AND pd.city_code = i_city_code);
    END LOOP;
    ELSE
    FOR i IN 1 .. i_custid.COUNT
    LOOP
    w_custid := i_custid (i);
    w_pymtref := i_pymtref (i);
    sp_031_process_time_zone_diff (w_time_zone_date);
    UPDATE tl_pymt_details
    SET status_code = 5,
    rejected_reason = i_rejreason
    WHERE cust_id = i_custid (i) AND pymt_ref = i_pymtref (i);
    INSERT INTO tl_pymt_details_trk
    (cust_id, pymt_ref, modi_date, status_code,
    payee_charge_status, modi_by, country_code, city_code)
    (SELECT cust_id, pymt_ref, w_time_zone_date, status_code,
    payee_charge_status, i_userid, pd.country_code,
    pd.city_code
    FROM tl_pymt_details pd, tl_sys_parm sp
    WHERE cust_id = i_custid (i)
    AND pymt_ref = i_pymtref (i)
    AND pd.country_code = i_country_code
    AND pd.city_code = i_city_code);
    END LOOP;
    END IF;
    o_intrc := 1;
    END testts;
    Your Help is highly appreciated.
    Regards,
    SImma....

    Hi,
    I supposed your varray is created by TYPE str_varray IS VARRAY(100) OF VARCHAR2(30); Then you can do the following:
    declare
      l_custid str_varray;
      l_pymtref str_varray;
      l_out number;
    begin
      /* filling of varray */
      l_custid := str_varray('test1','test2');
      l_pymtref := str_varray('test4','test5');
      /* call procedure */
       testts (
           i_custid => l_custid,
           i_pymtref => l_pymtref,
           i_screen =>   ..... , -- set value
           i_rejreason =>   ..... , -- set value
           i_userid =>   ..... , -- set value
           i_country_code =>   ..... , -- set value
           i_city_code =>   ..... , -- set value
           o_intrc => l_out
    end;Herald ten Dam
    http://htendam.wordpress.com

Maybe you are looking for

  • How do you print an envelope in Pages?

    I want ro print an envelope for my letter.  How do I do this in Pages?

  • How do you report Net Balance of A/R Down Payment Invoice?

    We have recently installed SAP B1 Version 8.8 at a new client site.  The client wants to accept A/R down payments from customers, issue invoices and draw the amount of the invoice from the down payment.  I can see the net amount in an open items list

  • When connecting Macbook Air to iMac, have to keep Macbook Air open in order to use the iMac as a display.

    When I connect my Macbook Air to my iMac with Thunderbolt, I have to keep my Macbook Air open or else the iMac does not sense it. I've tried closing it to just use the iMac as the display, but then the iMac goes back to its regular screen. Also, I ha

  • IWeb crashes on startup

    Greetings, Working on iWeb (version 3.0.2) today when there was a sudden power failure. Now, iWeb crashes on startup and I am not sure how to fix the problem. iWeb gets far enough into the startup to show the "Inspector" pallet before crashing. No ot

  • Installation errors. 1310, 1603

    I finally got the cloud to install and function on my laptop. Once i went to install LR, it downloaded most of the way then gave me the following message. ERROR: Error 1310.Error writing to file: C:\Config.Msi\126a4d2d.rbf. Verify that you have acces