Reg procedures and cursors

Hello,
I am getting errors when i am trying to run the foll pl/sql pgm in oracle 10g.
the question is
a PL/SQL block wrapper with cursor, exception, and a function or procedure, computing the amount that the customer spent on books, and generating corresponding gift promotion. This function or procedure should accept the gift name as input parameter; output the number of customers who are qualified to get the gift, and the average amount that these customers spend. Note you need to create a table in the program which records the gift distribution condition in advance. The new table’s structure is as below:
giftStatistics (
gift varchar2(15);
numberOfCustomers number;
averageAmount number
Where numberOfCustomers refers to the number of customers who should be given with this gift; averageAmount refers to the amount that the customers spent, who should be given with this gift.
If the gift name is not in the promotion table, the program need to generate exception; if the tuple concerning the gift is not generated yet, the program need to insert a new tuple; otherwise, the program just need to output the tuple.
My program:
create or replace procedure gift(in_name in varchar2,out_noc out number)
AS
cursor check_gift is
select gift,minretail,maxretail from promotion;
cursor gift_noduplicate is
select gift,numberofcustomers,averageamount from giftstatistics;
cursor cursor_gift is
select c.lastname,sum(i.quantity*b.retail) from
     customers c,orders o,orderitems i,books b
     where c.customer# = o.customer#
          and o.order# = i.order#
          and i.isbn = b.isbn
               group by c.lastname;
count_customers number := 0;
count_average number := 0;
gift_name varchar2(20);
min_retail number(5,2);
max_retail number(5,2);
l_name varchar2(20);
gift_value number(5,2);
gift_local varchar2(30);
noc number(5,2);
avg number(5,2);
BEGIN
open check_gift;
loop
FETCH check_gift into gift_name,min_retail,max_retail;
exit when check_gift%NOTFOUND;
loop
open gift_noduplicate;
     fetch gift_noduplicate into gift_local,noc,avg;
          exit when gift_noduplicate%notfound;
if (gift_name=gift_local) then      
loop
open cursor_gift;
     FETCH cursor_gift into l_name,gift_value;
     exit when cursor_gift%NOTFOUND;
loop
if gift_value >= min_retail AND gift_value <= max_retail THEN
count_customers := count_customers + 1;
count_average := count_average +gift_value;
     update giftstatistics
     set numberofcustomer:=count_customers,
     set averageamount:=count_average;
end if;
END LOOP;
end loop;
else
insert into giftstatistics values(gift_local,count_customers,count_average);
end loop;
END LOOP;
close check_gift;
close gift_noduplicate;
close cursor_gift;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE('Invalid requests');
END gift;
Could you please help me with this?
Thank you
Vinay

Vinay,
update giftstatistics
set numberofcustomer:=count_customers,
set averageamount:=count_average;use = in an update statement not :=
and, do you want a 'where' clause in this update so all rows are not updated?
hope this helps,
Peter

Similar Messages

  • Please check the below Cursor Procedure and correct that code Please

    Hai Every One.
    Please check the below code I have two issues in that code
    1. Invalid cursor
    2. Record must be enter
    Please correct this code and send me pls its urgent.I cont understand where i done mistake
    PROCEDURE fetch_detail_PROC IS
    cursor c1 is select * from quota_mast where quota_mast.divn=:quota_mast.divn and quota_mast.QUOT_tyPE=:quota_mast.QUOT_tyPE and quota_mast.INQNO=:quota_mast.INQNO;
    cursor c6 is select * from quota_det
    where quota_det.divn=:quota_mast.divn AND quota_det.QUOT_TYPE=:quota_mast.QUOT_tyPE and quota_det.enq_num=:quota_mast.INQNO
    ORDER BY quota_det.quot_no;
    --cursor c5 is select * from acc_mst where cdp=:quota_mast.ccdp and divn=:quota_mast.divn;
    --vn acc_mst%rowtype;
    i quota_mast%rowtype;
    detail1 quota_det%rowtype;
    BEGIN
         GO_BLOCK('quota_mast');
    for i in c1 LOOP
              :quota_mast.INQNO:=i.INQNO;
                        :quota_mast.DIVN:=i.DIVN;
                   :quota_mast.QUOT_NO:=i.QUOT_NO;
                        :quota_mast.quot_type:=i.quot_type;
                        :quota_mast.CCDP:=i.CCDP;
                        select nm into :QUOTA_MAST.PARTY_NAME from acc_mst where acc_mst.DIVN=:QUOTA_MAST.DIVN AND acc_mst.cdp=:ccdp;
                        :quota_mast.pak_for:=i.pack_for_PER;
                        :quota_mast.exc_duty:=i.exc_duty_PER;
                        :quota_mast.vat:=i.vat_PER;
                        :quota_mast.cst:=i.cst_PER;
                        :quota_mast.wct:=i.wct_PER;
                        :quota_mast.ser_tax:=i.ser_tax_PER;
                        :quota_mast.insu:=i.insu_PER;
                        :quota_mast.tot_tax:=i.tot_tax;
                        :quota_mast.tot_val:=i.tot_val;
                   :quota_mast.value:=i.value;
                                  next_record;
    end loop;
         first_record;
    GO_BLOCK('quota_det');
                   for detail1 in c6
              loop
                        :quota_det.quot_no:=detail1.quot_no;
              :quota_det.ENQ_NUM:=detail1.enq_num;
              :quota_det.item_code:=detail1.item_code;
              SELECT ITNM into :NM FROM itm_MST WHERE DIVN=:quota_mast.DIVN AND iCDP=:ITEM_CODE;
              :quota_det.price:=detail1.price;
              :quota_det.qty:=detail1.qty;
              :quota_det.DISC_PER:=detail1.DISC_PER;
                   next_record;
    END LOOP;
         first_record;
    close c6;
    --close c1;
    exception
    when others then
    message(sqlerrm);
    message(' ');
    END;
    Thank you..

    Oracle Forms is closely tied to the database meaning you can base your data blocks on your tables and Forms will handle fetching the data. I agree with Christian, your tables lend themselves to using a master - detail configuration and if you need to filter your block then you can use the Data Block WHERE Clause property.
    Please correct this code and send me pls its urgent.As to the urgency of your request, the forum is a community of "Volunteers." Enough said.
    Regarding your code, I see a several potential problems.
    First, how are your QUOTA_MAST and QUOTA_DET blocks synchronized? Are you using a block relationship? Are you using a combination of triggers to synchonize the QUOTA_DET block when you user navigates to a different record in the QUOTA_MAST block?
    Second, your Procedure name is "Fetch_Detail_Proc" but you are also fetching Master data as well. What is the purpose of your procedure and where do you call this procedure?
    Third, you're using SELECT * in your cursor queries. You should always explicitly name each column. What happens when your table changes and you need to search your code for a column that was dropped?
    Fourth, your cursor queries are referencing the same data blocks you are fetching data to populate. This gives the impression that you already have data in your block. This doesn't make sense - could you explain what you are trying to accomplish?
    Fifth, with respects to your code, the "Invalid Cursor" error (is this really the error you're getting?) is most likely caused by your explicit call to close the C1 cursor. As Andreas stated, when using a CURSOR FOR LOOP, the cursor is automatically opened, fetched and closed using this construct. There is no need to explicitly close the cursor, in fact - doing so will result in an invalid cursor error.
    As to the "Record must be entered" error, is sounds like you have required items in your block or your QUOTA_MAST block is not synchronized with your QUOTA_DET block, so when you attempt to navigate to a different block or record within your the same block the navigation cursor can't move because you haven't entered data that is required.
    Please tell us what you are attempting to do with this code so we can tell you if you are using the correct method.
    Craig...

  • Pass REF CURSOR to Procedure and LOOP through it

    Hi All,
    I am trying to figure out how I can pass a ref cursor to a procedure and then loop through it. I have provided an example of what I am attempting to do...just not really sure how to open the ref cursor when it is passed ot the sproc and iterate through it?
    Any info would be greatly appreciated.
    Version:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE     10.2.0.3.0     Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Create Or Replace Package test_ref_pkg
    AS
    function get_ref_curs
    RETURN SYS_REFCURSOR;
    procedure process_ref_curs(
    p_ref_cursor        IN  SYS_REFCURSOR
    END test_ref_pkg;
    Create Or Replace Package Body test_ref_pkg
    AS
    function get_ref_curs
        RETURN SYS_REFCURSOR
    IS
        l_ref_curs      SYS_REFCURSOR;
    BEGIN
        OPEN l_ref_curs FOR
        Select 1 ID, 'Test 1' Name
        From DUAL
        UNION ALL
        Select 2 ID, 'Test 2' Name
        From DUAL;
    END get_ref_curs;
    procedure process_ref_curs(
    p_ref_cursor        IN  SYS_REFCURSOR
    IS
    BEGIN
        ---NOT SURE WHAT TO DO TO ITERATE THROUGH THE REF CURSOR I AM PASSING INTO THIS SPROC?----
    END process_ref_curs;
    END test_ref_pkg;Thanks,
    S
    Edited by: ScarpacciOne on May 28, 2010 9:11 AM

    ---NOT SURE WHAT TO DO TO ITERATE THROUGH THE REF CURSOR I AM PASSING INTO THIS SPROC?----
    -- MAYBE I AM SIMPLE, BUT HOW ABOUT FETCH???
    -- if you start to yell, I will yell too!!!!
    Sybrand Bakker
    Senior Oracle DBA

  • Tuning a procedure and using dbms_job.submit proc that call's functions

    Hi
    I have Procedure that have 3 curosrs which are nested one below with in each other
    and it looks as below
    it's structure will look some thing look like this
    declare
    empno_fetch number;
    CURSOR deu_process IS
    SELECT empno
    FROM emp
    WHERE flg_process = 'N'
    AND ROWNUM <= 5000
    ORDER BY empno;
    CURSOR dup_all IS --c1 fetch around 400000 records
    (select empno
    from emp
    where empno>l_empno
    order by empno
    where rownum<=empno_fetch;
    CURSOR rules IS --c2
    SELECT rule_id, rule_score, name_Of_func
    FROM rule;
    begin
    l_count := 1;
    OPEN dedupe_rule_attr;
    LOOP
    BEGIN
    Here one loop is used for fetching 5000 records at time and
    Here deu_process cursor is opened ,assume it fetches one record
    Here another cursor dup_all is used for fetching the records and assume it fetched 400000 then
    Here another cursor is opened name where it fetches 10 rows
    Here logic is if first row then
    call's stored function which has following functionalty
    it compares fields such as address of outer most cursor i.e deu_process with all the address of the other rows i.e 400000 rows and return a number
    if second row then
    call's another stored function which has
    compares other fields such as first name,last name
    if third then other field
    so on ....
    up to 10
    and then finally ends
    so if i comment all the rules loop then it takes only one min to execute .If it validaes all of them if takes 14 minutes to execute .so there is problem in that 10 procedures to execute
    So i found an approach to run all the rules simultaneously using dbms_job .But i face a problem that i can't uderstand how to send the input and out put parameter's to calling procedure.And these parameter's must be passed by variable from called procedure to calling procedure
    Please suggest me what is the syntax of dbms_job with input and output parameters with variable's that must be passed as formal parameter's
    Regarding DBMS_JOB.SUBMIT I am getting following error
    Declare
    x number:=1;
    b number;
    jobnumber number;
    BEGIN
    DBMS_JOB.SUBMIT(JOB => jobnumber,
    WHAT => 'vamsi_proc1('||x||');',
    NEXT_DATE => (sysdate+1/(86400)),
    INTERVAL => null);
    --dbms_output.put_line('value of b is '||b);
    COMMIT;
    END;
    Declare
    ERROR at line 1:
    ORA-06550: line 1, column 107:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    ( - + case mod new not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    The symbol "null" was substituted for ")" to continue.
    ORA-06512: at "SYS.DBMS_JOB", line 79
    ORA-06512: at "SYS.DBMS_JOB", line 136
    ORA-06512: at line 5
    create or replace procedure vamsi_proc1(v in out number) as
    x number(4);
    begin
    --a:=1;
    insert into emp_vamsi(select 677,ENAME,SAL,DEPTNO,MANAGER from emp where empno=v);
    commit;
    --a:=2;
    --x:=a;
    end;
    using dbms_job.submit proc that call's functions which returns out and in parameters to calling procedure environment .I can't get this with out using data base table's.
    If you have any method for this Plese suggest
    And also please suggest me weather using job's is a good idea ,If not than suggest me what ever will the other approach.
    Thank's and Regard's
    vamsi krishna

    Hi <br>
    I have looked at all sql trace file ,<br>
    I found that there is no problem in sql statemens all of them are using proper <br>indexes execpt the folllowing statement<br>
    <br>
    SELECT nvl(COUNT(ref_appln_no),0)<br>
    FROM ci_cust_dedupe_mast<br>
    WHERE flg_mnt_status='A'<br>
    <br>
    This statement executes only once for 1*3,77000*10 times <br>
    The function that i had sent previously executes more than 4000000*20 times .<br>
    I think all it takes is only for iterations that are caused<br>
    <br>
    I am also sending sql trace for reference
         <br>
    TKPROF: Release 9.2.0.4.0 - Production on Mon Aug 14 17:30:50 2006     <br>
         <br>
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.     <br>
         <br>
    Trace file: afhuat_ora_2204.trc     <br>
    Sort options: default     <br>
         <br>
    ********************************************************************************     <br>
    count = number of times OCI procedure was executed     <br>
    cpu = cpu time in seconds executing      <br>
    elapsed = elapsed time in seconds executing     <br>
    disk = number of physical reads of buffers from disk     <br>
    query = number of buffers gotten for consistent read     <br>
    current = number of buffers gotten in current mode (usually for update)     <br>
    rows = number of rows processed by the fetch or execute call     <br>
    ********************************************************************************     <br>
         <br>
    alter session set sql_trace=true     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 0 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 1 0.00 0.00 0 0 0 0     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Misses in library cache during execute: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61      <br>
    ********************************************************************************     <br>
         <br>
    declare     <br>
    x varchar2(100);     <br>
    y varchar2(100);     <br>
    ap number;     <br>
    begin     <br>
    x:=to_char(sysdate,'dd-mon-rrrr hh:mi:ss');     <br>
    ap:=ap_ci_dedupe_proc;     <br>
    y:=to_char(sysdate,'dd-mon-rrrr hh:mi:ss');     <br>
    dbms_output.put_line(x||' '||ap);     <br>
    dbms_output.put_line(y||' '||ap);     <br>
    end;     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 820.23 0 0 0 1     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 2 0.00 820.23 0 0 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61      <br>
    ********************************************************************************     <br>
         <br>
    select user#      <br>
    from     <br>
    sys.user$ where name = 'OUTLN'     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.00 0 2 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.00 0 2 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS BY INDEX ROWID USER$ (cr=2 r=0 w=0 time=31 us)     <br>
    1 INDEX UNIQUE SCAN I_USER1 (cr=1 r=0 w=0 time=18 us)(object id 44)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    SELECT *     <br>
    FROM ci_dedupe_rule_attr     <br>
    ORDER BY cod_rule_attr_id     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.06 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 21 0.00 0.01 1 3 0 20     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 23 0.00 0.07 1 3 0 20     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT COUNT(1)     <br>
    FROM ci_cust_dedupe_mast     <br>
    WHERE flg_process = 'N'     <br>
    AND     <br>
    AND     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.00 0 22 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.00 0 22 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT nvl(COUNT(ref_appln_no),0)     <br>
    FROM ci_cust_dedupe_mast     <br>
    WHERE flg_mnt_status='A'     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 1.68 3.03 18867 21183 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 1.68 3.03 18867 21183 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT ref_appln_no     <br>
    FROM ci_cust_dedupe_mast     <br>
    WHERE flg_process = 'N'     <br>
    AND     <br>
    AND     <br>
    AND     <br>
    ORDER BY ref_appln_no     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.09 18 43 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.09 18 43 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT     <br>
    FROM     <br>
    WHERE     <br>
    AND     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 377709 8.71 7.64 0 0 0 0     <br>
    Fetch 377709 18.18 60.19 19802 1510836 0 377709     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 755419 26.90 67.84 19802 1510836 0 377709     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT NVL(MAX(cod_serial_no),0) + 1     <br>
    FROM ci_dedupe_details_mast     <br>
    WHERE ref_appln_no = :b1     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.01 2 2 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.01 2 2 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT COUNT(1)     <br>
    FROM ci_dedupe_details_mast     <br>
    WHERE ref_appln_no = :b1     <br>
    AND     <br>
    AND flg_mnt_status = 'A'     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.00 0 3 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.00 0 3 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT ref_appln_no FROM     <br>
    (     <br>
    SELECT ref_appln_no     <br>
    FROM ci_cust_dedupe_mast     <br>
    WHERE     <br>
    AND     <br>
    ORDER BY ref_appln_no     <br>
    )     <br>
    WHERE ROWNUM <= :b2     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 77 0.01 0.00 0 0 0 0     <br>
    Fetch 377786 10.21 12.33 908 377865 0 377709     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 377864 10.23 12.33 908 377865 0 377709     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    SELECT cod_rule_id, cod_rule_score, nam_rule_func     <br>
    FROM ci_dedupe_rule_defn     <br>
    WHERE flg_valid = 'Y'     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 377708 5.50 4.03 0 0 0 0     <br>
    Fetch 4154788 62.79 54.04 16 4532496 0 3777080     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 4532497 68.29 58.07 16 4532496 0 3777080     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    select con#,obj#,rcon#,enabled,nvl(defer,0)      <br>
    from     <br>
    cdef$ where robj#=:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 2 0.00 0.01 1 2 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.01 1 2 0 0     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),     <br>
    rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)      <br>
    from     <br>
    cdef$ where obj#=:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 2 0.00 0.01 2 4 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.01 2 4 0 0     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    select u.name,o.name, t.update$, t.insert$, t.delete$, t.enabled      <br>
    from     <br>
    obj$ o,user$ u,trigger$ t where t.baseobject=:1 and t.obj#=o.obj# and      <br>
    o.owner#=u.user# order by o.obj#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 3 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 0.00 0 0 0 0     <br>
    Fetch 4 0.00 0.05 6 9 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 10 0.00 0.05 6 9 0 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    0 SORT ORDER BY (cr=1 r=1 w=0 time=4772 us)     <br>
    0 NESTED LOOPS (cr=1 r=1 w=0 time=4747 us)     <br>
    0 NESTED LOOPS (cr=1 r=1 w=0 time=4744 us)     <br>
    0 TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=1 r=1 w=0 time=4740 us)     <br>
    0 INDEX RANGE SCAN I_TRIGGER1 (cr=1 r=1 w=0 time=4736 us)(object id 130)     <br>
    0 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=0 r=0 w=0 time=0 us)     <br>
    0 INDEX UNIQUE SCAN I_OBJ1 (cr=0 r=0 w=0 time=0 us)(object id 36)     <br>
    0 TABLE ACCESS CLUSTER USER$ (cr=0 r=0 w=0 time=0 us)     <br>
    0 INDEX UNIQUE SCAN I_USER# (cr=0 r=0 w=0 time=0 us)(object id 11)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,     <br>
    o.dataobj#,o.flags      <br>
    from     <br>
    obj$ o where o.obj#=:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.02 5 9 0 3     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 8 0.00 0.02 5 9 0 3     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 3)     <br>
    ********************************************************************************     <br>
         <br>
    select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))      <br>
    from     <br>
    objauth$ where obj#=:1 and col# is not null group by privilege#, col#,      <br>
    grantee# order by col#, grantee#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 3 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.01 2 6 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 9 0.00 0.02 2 6 0 0     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    INSERT INTO ci_dedupe_details_mast     <br>
    VALUES     <br>
    (     <br>
    :b6,     <br>
    :b5,     <br>
    :b4,     <br>
    :b3,     <br>
    'Y',     <br>
    'N',     <br>
    '',     <br>
    0,     <br>
    SYSDATE,     <br>
    'A',     <br>
    ' ',     <br>
    :b2,     <br>
    'SYSTEM',     <br>
    :b1,     <br>
    1     <br>
    )     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.01 3 3 0 0     <br>
    Execute 1 0.00 0.01 4 1 6 1     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 2 0.00 0.02 7 4 6 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    select obj#,type#,ctime,mtime,stime,status,dataobj#,flags,oid$, spare1,      <br>
    spare2      <br>
    from     <br>
    obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null      <br>
    and linkname is null and subname is null     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.01 2 3 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.01 2 3 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    select audit$,options      <br>
    from     <br>
    procedure$ where obj#=:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.01 3 3 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.01 3 3 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS BY INDEX ROWID PROCEDURE$ (cr=3 r=3 w=0 time=14110 us)     <br>
    1 INDEX UNIQUE SCAN I_PROCEDURE1 (cr=2 r=2 w=0 time=13871 us)(object id 115)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select owner#,name,namespace,remoteowner,linkname,p_timestamp,p_obj#,      <br>
    d_owner#, nvl(property,0),subname      <br>
    from     <br>
    dependency$,obj$ where d_obj#=:1 and p_obj#=obj#(+) order by order#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 4 0.00 0.07 8 12 0 3     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.07 8 12 0 3     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    3 SORT ORDER BY (cr=12 r=8 w=0 time=72867 us)     <br>
    3 NESTED LOOPS OUTER (cr=12 r=8 w=0 time=72813 us)     <br>
    3 TABLE ACCESS BY INDEX ROWID DEPENDENCY$ (cr=4 r=4 w=0 time=41297 us)     <br>
    3 INDEX RANGE SCAN I_DEPENDENCY1 (cr=3 r=3 w=0 time=25897 us)(object id 127)     <br>
    3 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=8 r=4 w=0 time=31484 us)     <br>
    3 INDEX UNIQUE SCAN I_OBJ1 (cr=5 r=2 w=0 time=14872 us)(object id 36)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select order#,columns,types      <br>
    from     <br>
    access$ where d_obj#=:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 2 0.00 0.02 3 4 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 4 0.00 0.02 3 4 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS BY INDEX ROWID ACCESS$ (cr=4 r=3 w=0 time=27026 us)     <br>
    1 INDEX RANGE SCAN I_ACCESS1 (cr=3 r=2 w=0 time=21717 us)(object id 129)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select /*+ index(idl_sb4$ i_idl_sb41) +*/ piece#,length,piece      <br>
    from     <br>
    idl_sb4$ where obj#=:1 and part=:2 and version=:3 order by piece#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.02 3 7 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 7 0.00 0.02 3 7 0 1     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    0 TABLE ACCESS BY INDEX ROWID IDL_SB4$ (cr=2 r=2 w=0 time=19830 us)     <br>
    0 INDEX RANGE SCAN I_IDL_SB41 (cr=2 r=2 w=0 time=19826 us)(object id 123)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece      <br>
    from     <br>
    idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.03 3 9 0 2     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 7 0.00 0.03 3 9 0 2     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    0 TABLE ACCESS BY INDEX ROWID IDL_UB1$ (cr=2 r=2 w=0 time=21757 us)     <br>
    0 INDEX RANGE SCAN I_IDL_UB11 (cr=2 r=2 w=0 time=21753 us)(object id 120)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select /*+ index(idl_char$ i_idl_char1) +*/ piece#,length,piece      <br>
    from     <br>
    idl_char$ where obj#=:1 and part=:2 and version=:3 order by piece#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 2 0.00 0.01 2 4 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.01 2 4 0 0     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    0 TABLE ACCESS BY INDEX ROWID IDL_CHAR$ (cr=2 r=2 w=0 time=19465 us)     <br>
    0 INDEX RANGE SCAN I_IDL_CHAR1 (cr=2 r=2 w=0 time=19461 us)(object id 121)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select /*+ index(idl_ub2$ i_idl_ub21) +*/ piece#,length,piece      <br>
    from     <br>
    idl_ub2$ where obj#=:1 and part=:2 and version=:3 order by piece#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.00 0 0 0 0     <br>
    Fetch 2 0.00 0.01 2 4 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 6 0.00 0.01 2 4 0 0     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    0 TABLE ACCESS BY INDEX ROWID IDL_UB2$ (cr=2 r=2 w=0 time=15070 us)     <br>
    0 INDEX RANGE SCAN I_IDL_UB21 (cr=2 r=2 w=0 time=15066 us)(object id 122)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select baseobject,type#,update$,insert$,delete$,refnewname,refoldname,     <br>
    whenclause,definition,enabled,property,sys_evts,nttrigcol,nttrigatt,     <br>
    refprtname,rowid      <br>
    from     <br>
    trigger$ where obj# =:1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.00 1 2 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.00 1 2 0 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=2 r=1 w=0 time=9352 us)     <br>
    1 INDEX UNIQUE SCAN I_TRIGGER2 (cr=1 r=1 w=0 time=9340 us)(object id 131)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select owner#      <br>
    from     <br>
    obj$ o where obj# = :1     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 1 0.00 0.00 0 3 0 1     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 3 0.00 0.00 0 3 0 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=3 r=0 w=0 time=15 us)     <br>
    1 INDEX UNIQUE SCAN I_OBJ1 (cr=2 r=0 w=0 time=7 us)(object id 36)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select tc.type#,tc.intcol#,tc.position#,c.type#, c.length,c.scale,     <br>
    c.precision#,c.charsetid,c.charsetform      <br>
    from     <br>
    triggercol$ tc,col$ c ,trigger$ tr where tc.obj#=:1 and c.obj#=:2 and      <br>
    tc.intcol#=c.intcol# and tr.obj# = tc.obj# and (bitand(tr.property,32) !=      <br>
    32 or bitand(tc.type#,20) = 20) union select type#,intcol#,position#,69,0,0,     <br>
    0,0,0 from triggercol$ where obj#=:3 and intcol#=1001 union select tc.type#,     <br>
    tc.intcol#,tc.position#,121,0,0,0,0,0 from triggercol$ tc,trigger$ tr where      <br>
    tr.obj# = tc.obj# and bitand(tr.property,32) = 32 and tc.obj# = :4 and      <br>
    bitand(tc.type#,20) != 20     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 0     <br>
    Fetch 34 0.00 0.05 8 236 0 33     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 36 0.00 0.05 8 236 0 33     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    33 SORT UNIQUE (cr=236 r=8 w=0 time=54877 us)     <br>
    33 UNION-ALL (cr=236 r=8 w=0 time=54606 us)     <br>
    33 NESTED LOOPS (cr=197 r=8 w=0 time=53779 us)     <br>
    33 NESTED LOOPS (cr=162 r=8 w=0 time=53053 us)     <br>
    77 TABLE ACCESS CLUSTER COL$ (cr=83 r=6 w=0 time=40045 us)     <br>
    1 INDEX UNIQUE SCAN I_OBJ# (cr=2 r=2 w=0 time=13764 us)(object id 3)     <br>
    33 INDEX RANGE SCAN I_TRIGGERCOL2 (cr=79 r=2 w=0 time=12523 us)(object id 133)     <br>
    33 TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=35 r=0 w=0 time=466 us)     <br>
    33 INDEX UNIQUE SCAN I_TRIGGER2 (cr=2 r=0 w=0 time=152 us)(object id 131)     <br>
    0 INDEX RANGE SCAN I_TRIGGERCOL2 (cr=2 r=0 w=0 time=5 us)(object id 133)     <br>
    0 NESTED LOOPS (cr=37 r=0 w=0 time=574 us)     <br>
    33 INDEX RANGE SCAN I_TRIGGERCOL2 (cr=2 r=0 w=0 time=81 us)(object id 133)     <br>
    0 TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=35 r=0 w=0 time=350 us)     <br>
    33 INDEX UNIQUE SCAN I_TRIGGER2 (cr=2 r=0 w=0 time=139 us)(object id 131)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))     <br>
    from     <br>
    objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by      <br>
    grantee#     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 3 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.00 0 6 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 9 0.00 0.00 0 6 0 0     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    UPDATE     <br>
    SET     <br>
    WHERE ref_appln_no = :b1     <br>
    AND flg_mnt_status = 'A'     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.16 9 8 17 1     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 2 0.00 0.16 9 8 17 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    select type#,blocks,extents,minexts,maxexts,extsize,extpct,user#,iniexts,     <br>
    NVL(lists,65535),NVL(groups,65535),cachehint,hwmincr, NVL(spare1,0)      <br>
    from     <br>
    seg$ where ts#=:1 and file#=:2 and block#=:3     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 3 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 0.00 0 0 0 0     <br>
    Fetch 3 0.00 0.01 3 9 0 3     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 9 0.00 0.01 3 9 0 3     <br>
         <br>
    Misses in library cache during parse: 0     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
         <br>
    Rows Row Source Operation     <br>
    ------- ---------------------------------------------------     <br>
    1 TABLE ACCESS CLUSTER SEG$ (cr=3 r=3 w=0 time=17332 us)     <br>
    1 INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=2 r=2 w=0 time=10258 us)(object id 9)     <br>
         <br>
    ********************************************************************************     <br>
         <br>
    INSERT INTO ci_dedupe_details     <br>
    VALUES     <br>
    (     <br>
    :b31,     <br>
    :b32,     <br>
    :b31,     <br>
    :b30,     <br>
    :b29,     <br>
    :b28,     <br>
    :b27,     <br>
    :b26,     <br>
    :b25,     <br>
    :b24,     <br>
    :b23,     <br>
    :b22,     <br>
    :b21,     <br>
    :b20,     <br>
    :b19,     <br>
    :b18,     <br>
    :b17,     <br>
    :b16,     <br>
    :b15,     <br>
    :b14,     <br>
    :b13,     <br>
    :b12,     <br>
    :b11,     <br>
    :b10,     <br>
    :b9,     <br>
    :b8,     <br>
    :b7,     <br>
    :b6,     <br>
    :b5,     <br>
    :b4,     <br>
    :b3,     <br>
    :b2,     <br>
    :b1,     <br>
    'N',     <br>
    0,     <br>
    'E' )     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.01 0.03 4 1 5 1     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 2 0.01 0.03 4 1 5 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,      <br>
    sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,      <br>
    spare1, spare2, avgcln      <br>
    from     <br>
    hist_head$ where obj#=:1 and intcol#=:2     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 36 0.00 0.00 0 0 0 0     <br>
    Fetch 36 0.00 0.02 3 108 0 36     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 73 0.00 0.02 3 108 0 36     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: RULE     <br>
    Parsing user id: SYS (recursive depth: 2)     <br>
    ********************************************************************************     <br>
         <br>
    COMMIT     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 2 0.00 0.01 0 0 1 0     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 4 0.00 0.01 0 0 1 0     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61 (recursive depth: 1)     <br>
    ********************************************************************************     <br>
         <br>
    BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;     <br>
         <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 1 0.00 0.00 0 0 0 0     <br>
    Execute 1 0.00 0.00 0 0 0 1     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 2 0.00 0.00 0 0 0 1     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Optimizer goal: CHOOSE     <br>
    Parsing user id: 61      <br>
         <br>
         <br>
         <br>
    ********************************************************************************     <br>
         <br>
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 2 0.00 0.00 0 0 0 0     <br>
    Execute 3 0.00 820.23 0 0 0 2     <br>
    Fetch 0 0.00 0.00 0 0 0 0     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 5 0.00 820.23 0 0 0 2     <br>
         <br>
    Misses in library cache during parse: 1     <br>
    Misses in library cache during execute: 1     <br>
         <br>
         <br>
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS     <br>
         <br>
    call count cpu elapsed disk query current rows     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    Parse 49 0.00 0.10 3 3 0 0     <br>
    Execute 755577 14.25 11.90 17 10 29 3     <br>
    Fetch 4910422 92.89 130.18 39671 6442895 0 4532611     <br>
    ------- ------ -------- ---------- ---------- ---------- ---------- ----------     <br>
    total 5666048 107.14 142.19 39691 6442908 29 4532614     <br>
         <br>
    Misses in library cache during parse: 11     <br>
         <br>
    17 user SQL statements in session.     <br>
    35 internal SQL statements in session.     <br>
    52 SQL statements in session.     <br>
    ********************************************************************************     <br>
    Trace file: afhuat_ora_2204.trc     <br>
    Trace file compatibility: 9.00.01     <br>
    Sort options: default     <br>
         <br>
    1 session in tracefile.     <br>
    17 user SQL statements in trace file.     <br>
    35 internal SQL statements in trace file.     <br>
    52 SQL statements in trace file.     <br>
    36 unique SQL statements in trace file.     <br>
    5666466 lines in trace file.     <br>
    Regards<br>
    vamsi krishna<br>

  • Pricing procedure and CIN master

    Hi MM Gurus,
         I need one simple procedure for creating Pricing Procedure.........and ......creating Excise details and relating  and can anybody show how the pricing procedure and excise (CIN) is related .
    Regards,
    Girish.C.M

    Hi,
    CIN Setting:
    Check Calculation Procedure
    In this activity, you can check and, if necessary, change existing procedures for tax calculation.
    Standard settings
    Calculation procedures containing the necessary specifications for the calculation and posting of taxes on sales/purchases have already been defined in the standard SAP system for certain countries. Every calculation procedure groups several tax types together into a condition type (for example, output tax or input tax) in the calculation procedure, and determines calculation rules for it.
    The calculation procedure determines for which amount the individual condition types are to be calculated. This can be the base amount (total of the expense items and the revenue items) or a subtotal. The entry in column FrmLvl, determines for which amount tax is calculated.
    Note
    In this activity, the condition types for the check and the possible change provided in the standard system are also displayed. Here, for example, the condition calculation rule, or for which base amount the tax is calculated is determined (= condition type).
    Recommendation
    If possible, do not change the condition types and calculation procedures provided in the standard system. Only check the standard condition types and calculation procedures regarding whether you can use them for your requirements. If necessary, make changes.
    Activities
    If you cannot use the standard settings, change the condition types and calculation procedures delivered to meet your requirements.
    Procedure (pricing, output control, acct. det., costing,...)
    Specifies the conditions that are allowed for a document and defines the sequence in which they are used.
    Example
    Procedures are used, for example, in the following applications:
    · Pricing in sales and distribution
    · Applying overhead in Product Costing (costing sheets) and for CO internal orders
    · Calculating accrued costs in Profitability Analysis
    · Output control (printed confirmations, EDI messages, electronic mail)
    · Account determination
    · Calculating taxes on sales/purchases
    · Calculating accruals in Cost Center Accounting
    · Pricing for resource planning
    Definition: condition type
    Controlling (CO)
    A distinction, in overhead calculation, is made between:
    · Base condition types, which determine the object for which the overhead is to be calculated
    · Overhead condition types, which define the percentage overhead to be applied
    In resource planning, a condition type determines the types of resource prices that are stored in the SAP System. These can be absolute or percentage values, for example.
    Real Estate Management (RE)
    An exact definition of a condition that specifies the amount paid for a specific service.
    Condition types include:
    · Basic rent
    · Advance payment for operating costs
    · Pest control
    Sales and Distribution (SD)
    A characteristic of a condition.
    For example, in pricing, different condition types are used to distinguish between a discount that refers to a net price and a discount that refers to a gross price.
    Treasury (TR)
    A characteristic of a condition used to classify financial transactions.
    Typical examples of condition types are interest, dividends, or full repayment upon maturity. The various parameters specified for the individual condition types determine how the flows are calculated in the cash flow.
    Return ->
    Definition: condition_type
    Condition type
    The condition type is used for different functions. In pricing, for example, the condition type lets you differentiate between different kinds of discount; in output determination, between different output types such as order confirmation or delivery note; in batch determination, between different strategy types.
    Access sequence
    With the access sequence you define
    · the condition tables used to access the condition records
    · the sequence of the condition tables
    · which field contents are the criteria for reading the tables
    Assign Country to Calculation Procedure
    In this activity, you enter the key for the calculation procedure which determines the conditions which are allowed per document and which defines the sequence of the conditions in the document for each country.
    Requirements
    Each calculation procedure which you enter must contain the necessary specifications for calculating and posting the taxes on sales/purchases. For more information on this, read the chapter "Create calculation procedure".
    Activities
    1. Assign a procedure for tax calculation to every country with which your company has business dealings.
    2. Make sure that the corresponding data for calculating taxes is stored for each calculation procedure which you enter here.
    Check and Change Settings for Tax Processing
    In this activity you make the necessary specifications for posting taxes. In doing this you specify under a process key the following indicators:
    · Tax type
    Output tax, input tax, additional taxes, or "not tax-relevant" can be specified as the tax type.
    · Nondeductibility of tax amounts
    For this, tax amounts are marked as not deductible.
    · Posting indicator
    Here you specify whether the tax amount is posted separately or distributed to expense or revenue items.
    · Tax not relevant to cash discount (Not discount relevant)
    This indicator is set only for Canada. If you select it, the system does not take into account the corresponding tax amount when determining the tax base.
    Standard settings
    Process keys with the most important characteristics for tax amounts have already been set in the standard SAP system.
    Recommendation
    Do not change the standard settings. Check whether you can use these process keys for your company, making changes only if necessary.
    Activities
    If you cannot use the standard settings, use new process keys and enter them in your calculation procedure. Do not change the standard SAP process keys.
    Note
    You must make enhancements to the standard settings if you want to specify a new account key in the "Create calculation procedure" activity. You must create and maintain this key beforehand in the "Settings for tax processing" activity.
    Internal processing key
    The internal processing keys are used by the system to determine accounts or posting keys for line items which are created automatically.
    The processing keys are defined in the system and cannot be changed by the user.
    Definition: posting key
    Financial Accounting (FI)
    A two-digit numerical key that determines the way line items are posted.
    This key determines several factors including the:
    · Account type
    · Type of posting (debit or credit)
    · Layout of entry screens
    Return ->
    Definition: posting_key
    Maintain Excise Registrations
    Use
    In this IMG activity, you maintain the data relating to your excise registrations.
    Activities
    Enter each of your excise registrations, specifying a four-character code for each.
    Definition: excise registration
    Financial Accounting (FI)
    An entity in India that is entitled by law to produce any goods liable to excise.
    Each entity is assigned its own excise registration number.
    Every factory that manufactures excisable goods is required to register separately, so that a business with seven factories requires seven registrations.
    Return ->
    Definition: excise registration
    Maintain Company Code Settings
    Use
    In this IMG activity, you maintain the data relating to your company codes.
    Maintain Plant Settings
    Use
    In this IMG activity, you maintain excise information relating to your plants.
    Maintain Excise Groups
    Use
    In this IMG activity, you define your excise groups. For each excise group, you can also control how various excise invoice transactions will work.
    Definition: excise group
    Financial Accounting (FI)
    A unit within an excise registration, in India, which keeps its own set of excise records.
    Whereas the excise registration reports to the excise authorities, the excise group is a purely internal organizational unit. Each excise group keeps records of all transactions that have to be reported to the excise authorities. When the time comes to present these records to the authorities, the excise registration compiles the information from all of its excise groups.
    Return ->
    Definition: excise group
    Maintain Series Groups
    Use
    In this IMG activity, you define the different excise series groups within your company. Series groups allow you to maintain multiple number ranges for the outgoing excise documents.
    Based on excise regulations and exemptions from the authorities you can maintain multiple number series for outgoing documents. But each of these series has to be declared to the excise authorities.
    Activities
    · Define excise series groups based on type of outgoing document
    · Assign series group to excise registration ID
    · If no financial postings are required for an Excise invoice in this seris group then you tick the 'No utilization' indicator.
    · If the CENVAT has to be paid immediately and you need not wait for the Fort nightly payment then mark the 'Immediate Utilization' indicator.
    Example
    You could define two series groups, group 001 for excise invoices, and group 002 for 57 F4 documents.
    Maintain Excise Duty Indicators
    Use
    In this IMG activity, you maintain the excise duty indicators.
    Maintain Postal Addresses
    Use
    In this IMG activity, you maintain the addresses of various customs and excise organizations that your company deals with.
    You use these addresses in the ARE Documents functions. When you create an ARE-1 or ARE-3, you enter the address of the excise department and the customs department involved in the export process. The system then prints their names and addresses on the AREs.
    You can then define a default local excise department for each excise group and a default customs department for each series group.
    Definition: ARE-1 document
    Logistics - General (LO)
    A form, in India, that companies have to fill out when they remove excisable goods from their manufacturing plants for export.
    The form exempts them from paying excise duty when they remove the goods from their premises.
    Return ->
    Definition: ARE-1 document
    Definition: ARE-3 document
    Logistics - General (LO)
    A form, in India, that allows companies to sell otherwise excisable goods from their premises without paying basic excise duty. The buyer of the goods must be in possession of a deemed export license.
    The ARE-3 states what goods are being removed and which deemed excise license covers it.
    Return ->
    Definition: ARE-3 document
    Maintain Subtransaction Type with Text
    Sub Transaction Type
    Sub transaction type is used for multiple purposes
    Subcontracting:
    It determines the subcontracting attributes and determines the accounts for the posting while doing a sub contracting transaction.
    Excise removals
    Sub transaction type is also used for determining the accounts while doing excise removals.
    With in CIN the account determination is based on the transaction type. So normally you can have a single set of accounts for Excise utilization. In case you need alternate account determination for handling various scenarios you can define sub transaction types. The sub transaction types and corresponding account assignments needs to be maintained in CIN customization
    Select Tax Calculation Procedure
    Use
    In this IMG activity, you specify which tax procedure you want to use for determining excise duties and sales taxes on input materials in India.
    · If you use condition-based excise determination, use a copy of the tax procedure TAXINN.
    · If you use formula-based excise determination, use a copy of the tax procedure TAXINJ.
    This tax procedure also supports condition-based excise determination, so that you can work with both concurrently.
    We strongly recommend that new customers use condition-based excise determination. Note that once you have started using a tax procedure, you cannot switch to another one, otherwise you will not be able to display old documents.
    Definition: condition-based excise determination
    Logistics - General (LO
    A method that the system uses of determining excise duty in India.
    This method requires you to create condition records for each combination of vendor or customer and material (and possibly other conditions).
    When you create a purchasing document, the system calls the tax procedure assigned to India. The tax procedure finds all of the condition records that you have created for that combination of vendor and material.
    When you create a sales document, the excise duties and sales taxes are determined by the pricing procedure (not the tax procedure).
    Return ->
    Definition: condition-based excise determination
    Definition: formula-based excise determination
    Logistics - General (LO)
    A method that the system uses of determining excise duty in India.
    This method was used in the Country Version India Add-On and requires you to maintain additional data in the Excise Rate Maintenance transaction, J1ID.
    When you create a purchasing document, the system calls the tax procedure assigned to India. Each of the excise duties in the tax procedure has its own condition types, and each condition type is assigned to a formula. This formula instructs the system to calculate the excise duty using the data that you have maintained in the Excise Rate Maintenance transaction.
    When you create a sales document, the system determines the excise duties and sales taxes using the pricing procedure (not the tax procedure).
    Return ->
    Definition: formula-based excise determination
    Maintain Excise Defaults
    Use
    In this IMG activity, you define which tax procedure and pricing condition types are used in calculating excise taxes using formula-based excise determination.
    Activities
    If you use condition-based excise determination, fill out the CVD cond. field and leave all the others blank.
    If you use formula-based excise determination, fill out all of the fields as follows:
    · Enter the tax procedure and the pricing conditions that are relevant for excise tax processing.
    · Specify the purchasing and sales conditions types used for basic excise duty, additional excise duty, special excise duty, and cess.
    · Specify the conditions in the sales order that are used for excise rates.
    · Specify the countervailing duty condition type used for import purchase orders.
    See also
    SAP Library -> Logistics -> Country Versions -> Asia-Pacific -> India -> Materials Management (MM) -> Condition-Based Excise Determination and -> Formula-Based Excise Determination.
    Definition: basic excise duty
    Financial Accounting (FI)
    The main type of excise duty in India.
    It is levied on a wide range of products, for example, foodstuffs, metals, jewellery, leather goods, and machinery.
    Return ->
    Definition: basic excise duty
    Definition: additional excise duty
    Financial Accounting (FI)
    A form of excise duty, in India, levied on a select range of products, for the most part, textiles.
    Return ->
    Definition: additional excise duty
    Definition: special excise duty
    Financial Accounting (FI)
    A form of excise duty in India on a limited number of goods, mostly luxury goods, including pan masala, sparkling waters, furs, and yachts.
    Return ->
    Definition: special excise duty
    Definition: cess
    Financial Accounting (FI)
    In India, a tax on the manufacture of certain products, mostly foodstuffs.
    Return ->
    Definition: cess
    Definition: countervailing duty
    Financial Accounting (FI)
    A form of excise duty imposed on imports that are subsidized by the country in which they were manufactured.
    Countervailing duty (also known as CVD) is intended to make the imports more expensive, thereby redressing any competitive advantage they might have over goods produced locally.
    Return ->
    Definition: countervailing duty
    Define Tax Code for Purchasing Documents
    Use
    In this IMG activity, you define a tax code for the purposes of calculating excise duty when you enter purchasing documents.
    Only carry out this activity if you use condition-based excise determination.
    Activities
    Create a new tax code, and set the tax code type to V (input tax). Do not make any other settings for it.
    See also
    SAP Library -> Logistics -> Country Versions -> Asia-Pacific -> India -> Materials Management (MM) -> Condition-Based Excise Deter
    Sales Tax Code
    The tax code represents a tax category which must be taken into consideration when making a tax return to the tax authorities.
    Tax codes are unique per country. The tax rate calculation rules and further features are stored in a table for each tax code.
    Procedure
    For tax-exempt or non-taxable transactions, you should use tax codes with a 0 percentage rate if the corresponding transactions are to be displayed in the tax returns.
    Note
    You must define new tax codes if tax rates are changed by the state. The old codes with the old tax rates must remain in the system until no more open items which use this tax code exist.
    Definition: tax code
    Financial Accounting (FI)
    A two-digit code that represents the specifications used for calculating and displaying tax.
    Examples of the specifications defined under the tax code are:
    · Tax rate
    · Type of tax (input tax or output tax)
    · Calculation method (percentage included or percentage separate)
    Return ->
    Definition: tax_code
    Definition: tax rate
    Financial Accounting (FI)
    The percentage rate used to calculate the tax amount.
    Return ->
    Definition: tax_rate
    Assign Tax Code to Company Codes
    Use
    In this IMG activity, assign the tax code for purchasing documents to the company codes where it will be used.
    Only carry out this activity if you use condition-based excise determination.
    See also
    SAP Library -> Logistics -> Country Versions -> Asia-Pacific -> India -> Materials Management (MM) -> Condition-Based Excise Determination
    Classify Condition Types
    Use
    In this IMG activity, you specify which condition types you use for which sort of tax. Note that this only applies to condition types that you use with the new excise determination method.
    The system uses this information when you create a document from another one. For example, when you enter an incoming excise invoice from a purchase order, or when you create an outgoing excise invoice from a sales order, the system determines the various excise duties in the excise invoice using the information that you have entered here.
    In addition, when you create a purchasing document, the system only uses the condition types that you enter here.
    · For taxes on purchases, use the condition types contained in the tax procedure.
    · For taxes on sales, use the condition types contained in the pricing procedures.
    Standard settings
    The standard system comes with sample settings for the tax calculation procedures and pricing procedures.
    Use these settings as a basis for your own.
    Maintain Chapter IDs
    Use
    In this IMG activity, you maintain the chapter IDs and the corresponding descriptions as per the schedules published by the Central Board of Excise and Customs.
    Definition: chapter ID
    Logistics - General (LO)
    The number given to a material in the schedules of materials published by the government of India.
    The schedule lists all materials involved in manufacturing, input materials and output materials alike. It shows how much excise duty is levied on each material.
    Each material in the schedule is assigned its own identification code, called "chapter ID."
    Example
    The schedule contains an entry for ceramic roofing tiles, which are liable to basic excise duty at 16%. The chapter ID associated with these tiles is 6903.10.
    Return ->
    Definition: chapter ID
    Assign Users to Material Master Screen Sequence for Excise D
    Use
    In this IMG activity, you customize the material master data so that it shows the information relating to excise duty.
    Standard settings
    Country Version India comes with a screen sequence (IN) that shows the excise duty fields. You have to assign it to each of your users.
    Activities
    1. Double-click User Screen Reference.
    2. Assign all users who need to see the excise duty information to the screen reference IN.
    Example
    Name Screen Reference
    MISHRA IN
    Screen Sequence Number
    Alphanumeric key identifying the screen sequence. The screen sequence defines the sequence of information units in the material master dialog. A screen sequence is made up of data screens. For information on the screen sequences defined in the standard R/3 system, see the IMG documentation Configuring the Material Master.
    Note
    When creating a screen sequence, use an alphanumeric key beginning with the letter Y or Z (customer name range). This key cannot subsequently be changed.
    Dependencies
    You can assign screen sequences to users in the IMG activity Assign Screen Sequences to Users/Material Types/Transactions/Industry Sectors.
    Screen reference depending on the user
    Grouping of users that determines what screens are displayed in accordance with the user master record when you maintain material master records. It also determines the order in which the screens appear.
    Definition: user master record
    User and Authorization Management (BC-SEC-USR)
    Record that contains important master data for a user in the SAP System.
    The user master record contains the assignment of one or more roles to the user. This is how a user menu and the corresponding authorizations for the activities contained in the user menu are assigned to the user. Only users who have a user master record can log on to the system.
    Return ->
    Definition: user_master_record
    Define Form Types
    Use
    In this IMG activity, you define which form types you want to record in the system. You can only use form tracking for the form types that you enter here.
    Example
    · Form type: CT3
    · Form description: Concessional tax form
    · Status: Receive
    Define G/L Accounts for Taxes
    Use
    In this IMG activity, you specify which G/L accounts you will use to record which taxes.
    Requirements
    You have set up G/L accounts for each of the processing keys listed below.
    Activities
    Assign an account to each of the following posting keys. The accounts for VS1, VS2, and VS3 are used as clearing accounts during excise invoice verification.
    · VS1 (basic excise duty)
    · VS2 (additional excise duty)
    · VS3 (special excise duty)
    · VS5 (sales tax setoff)
    · MWS (central sales tax)
    · MW3 (local sales tax)
    · ESA (service tax)
    · ESE (service tax expense)
    Specify Excise Accounts per Excise Transaction
    Use
    In this IMG activity, you specify which excise accounts (for excise duty and CENVAT) are to be posted to for the various transaction types. Enter all the accounts that are affected by each transaction type.
    If you use subtransaction types, enter the accounts for each subtransaction type as well.
    Activities
    Transaction type UTLZ is used for determining accounts only while posting excise JVs and also if the payment of excise duty has to be done fortnightly.
    The fortnightly CENVAT payment utility picks up the credit side accounts from the transaction types of GRPO, EWPO, and TR6C for determining the CENVAT and PLA accounts. There is no separate transaction type for fortnightly payment.
    Example
    Excise TT DC ind Account name
    GRPO CR CENVAT clearing account
    GRPO CR RG 23 BED account
    GRPO DR CENVAT on hold account
    Specify G/L Accounts per Excise Transaction
    Use
    In this IMG activity, you assign the excise and CENVAT accounts to G/L accounts.
    When you come to execute the various transactions, the system determines which G/L accounts to post to by looking at the:
    · Excise group
    · Company code
    · Chart of accounts
    Furthermore, if you want separate account determination settings within an excise group, you can also use sub transaction types.
    Requirements
    You have already:
    · Defined the G/L accounts
    · Defined the excise groups
    · Maintained the transaction accounts
    Activities
    For each excise group, assign the excise and CENVAT accounts to G/L accounts. For most businesses, one set of accounts will suffice for alltransactions.
    Note
    You need not remit the CENVAT to the excise department immediately, so maintain the credit account for transaction type DLFC as an excise duty interim account. This will be set off when you remit the duty.
    Define Processing Modes Per Transaction
    Use
    In this IMG activity, you specify which processing modes the user can use in the various Incoming Excise Invoice transactions.
    This way, you can tailor the transaction to what your users have to do.
    Standard settings
    The system comes with three standard transactions relating to the Incoming Excise Invoices function (those that are included in the role SAP_CIN). The processing modes available in these transactions are as follows:
    · J1IEX_C
    This transaction is for excise clerks: users of this transaction can only capture and display excise invoices.
    · J1IEX_P
    This transaction is for excise supervisors: they can change, display, cancel, and post excise invoices.
    · J1IEX
    In this transaction, users can capture and post excise invoices, as well as displaying, changing, and canceling them.
    Activities
    If the standard settings meet your requirements, do not do anything.
    Otherwise, you can adjust the standard settings or you can create your own transactions. To do so:
    1. In Maintain Transaction, create a new transaction by making a copy of one of the standard transactions. Give the new transaction a transaction code of your choice.
    2. In this activity, enter data as follows:
    o Tcode: The transaction code that you have just created.
    o Proc. mode: Specify what the users of the transaction will do with the excise invoices.
    o Active: Select this indicator to activate the setting.
    Example
    You might want to create a transaction that only allows users to display excise invoices.
    Define Reference Documents Per Transaction
    Use
    In this IMG activity, you specify for each combination of transaction and processing mode which reference documents you want the users to be able to use.
    Activities
    If the standard settings meet your requirements, you do not have to do anything.
    Otherwise, add the entries that you need to the table: For each transaction, make one entry per combination of processing mode and reference document. Activate each entry for it to work.
    Definition: excise invoice reference document
    Logistics - General (LO)
    A document, in India, that you refer to when you enter an incoming excise invoice.
    If you have already posted the goods receipt, you can use the goods receipt document as the reference document. Otherwise, you can use the purchase order (or another purchasing document, such as a be a contract or a scheduling agreement).
    Example
    In the SAP System, you create a purchase order for 100 bags of sand and send the order to your vendor. Two weeks later, the vendor delivers the sand, accompanied by an excise invoice.
    When you enter the excise invoice in the system, you specify the number of the original purchase order: this is the reference document.
    Return ->
    Definition: excise invoice reference document
    Maintain Rejection Codes
    Use
    In this IMG activity, you define the rejection codes that are used in the Incoming Excise Invoices transaction.
    Activities
    For each rejection code, enter a code and a description. You can also specify whether the excise duty in the invoice is to be posted to the CENVAT on hold account, instead of the CENVAT clearing account.
    Specify Which Movement Types Involve Excise InvoicesUse
    In this IMG activity, you specify which movement types relating to goods receipts involve excise invoices.
    The system uses this information during the goods receipt procedure. When you post a goods receipt using one of the moevement types that you have specified here, the system prompts you to enter the excise invoice number.
    Note
    This option cannot be used for processing goods receipts without purchase orders.
    Maintain Default Excise Groups and Series Groups
    Use
    In this IMG activity, you specify which excise group and series group you want to appear in these fields by default. You can make separate settings for different combinations of sales organization, distribution channel, division, and shipping point.
    Activities
    This activity is optional, unless you want the system to automatically create outgoing excise invoices when you create a customer invoice.
    In this case, you must also make the appropriate setting in Customizing for Excise Duty, by choosing Basic Subcontracting Attributes
    Use
    The subcontracting attributes help determine conditions for a combination of an excise group, a transaction type, and a subtransaction type.
    The conditions such as the number of excise items per subcontracting challan, if the nonexciseable materials have to be filtered or not when the subcontracting challan is created, the movement type groups for issues and receipts and the hierarchy of determining the excise base value are mentioned here.
    Requirements
    Before you continue with this activity, work through the following activities:
    · Materials Management -> Inventory Management and Physical Inventory -> Goods Issue / Transfer Postings -> Define Screen Layout.
    For the movement type 541, maintain the field Purchase Order as an optional entry or as a required entry.
    · Materials Management -> Inventory Management and Physical Inventory -> Output Determination ->Maintain OutputTypes.
    Maintain the output type. On the Default Values tab, maintain the dispatch time and the transmission medium. Maintain the print parameter on the Print tab. This output type has to be maintained in this activity here.
    · Materials Management -> Inventory Management and Physical Inventory -> Output Determination ->Assign Forms andPrograms.
    Maintain the Program, FORM routine, and the form for the output type.
    · Materials Management -> Inventory Management and Physical Inventory -> Output Determination ->Printer Determination -> Printer Determination by Plant / Storage Location.
    Enter the output device that you use.
    Settings -> Maintain Excise Groups, and selecting Create EI (Create Excise Invoice Automatically).
    Maintain Movement Type Groups
    Use
    In this IMG activity, you group movement types together to form movement type groups.
    Definition: movement type
    Inventory Management (MM-IM)
    A classification key indicating the type of material movement (for example, goods receipt, goods issue, physical stock transfer).
    The movement type enables the system to find predefined posting rules determining how the accounts of the financial accounting system (stock and consumption accounts) are to be posted and how the stock fields in the material master record are to be updated.
    Return ->
    Definition: movement type
    Utilization Determination
    Use
    In this IMG activity, you specify which CENVAT accounts are to be debited by the Fortnight Utilization of CENVAT report: When the report calculates how much excise duty you must remit, it automatically proposes which CENVAT accounts the duty should be debited to. Here, you specify those defaults.
    You can either:
    · Debit all the excise duty to one account
    · Debit the excise duty to more than one account, in which case you specify which percentage is to be debited to each account
    Example
    If you want 50% of basic excise duty (BED) to be debited to the RG 23A account and the remaining 50% to the RG 23C account, you would make the following settings:
    Acct name BED perc.
    RG 23A BED account 50
    RG 23C BED account 50
    Alternatively, to debit all of the BED to the RG 23A account, and then RG 23C account, if there is not enough in the RG 23A account, you would make the following settings:
    Acct name BED perc. +
    RG 23A BED account X
    RG 23C BED account X
    When you come to run the report, the system takes the RG 23A account because it is the first one you have entered. If this account does not cover the BED, the system takes the RG 23C account instead.
    Maintain Minimum Balances for Excise Accounts
    Use
    In this IMG activity, you can maintain minimum balances in your excise accounts. When the balance in these accounts during utilization falls below this level, the system automatically utilizes funds in the PLA account.
    Activities
    Maintain the minimum balance amount for the excise accounts. If you have more than one excise group, you can maintain different minimum balances.
    Specify SAPscript Forms
    Use
    In this IMG activity, for each of your company codes, you specify which SAPscript forms the system prints the excise registers with.
    Standard settings
    Country Version India includes a number of sample SAPscript forms and printing programs, which you can use as follows:
    Reg. name Lay. no. Form Tcode/Prog
    RG 23A Part I 1 J_2IRG23A_PART1 J_2IRAP1
    RG 23C Part I 1 J_2IRG23C_PART1 J_2IRCP1
    RG 23A Part II 1 J_2IRG23A_PART2 J_2IRAP2
    RG 23C Part II 1 J_2IRG23C_PART2 J_2IRCP2
    PLA 1 J_2I_PLA J_2IPLA
    RG 23 D 1 J_2I_RG23D J_2IRG23
    RG 1 1 J_2I_RG1 J_2IRRG1
    RT 12 1 J_2I_RT12_ABSTRA J_2IRT12
    RT 12 1 J_2I_RT12_ABSTRA J_2IRT12
    RT 12 1 J_2I_RT12_3 J_2IRT12
    The layout description can be left blank or an appropriate description maybe filled in. You may not change the register name. You can have your own layouts and maintain the name here. If the output device and number of copies are maintained it is automatically picked up for printing.
    Number Ranges
    You can maintain the number ranges for all CIN Number range objects using this transaction
    Activities
    Please maintain the number ranges for the folllowing objects The no nr has to be '01' for all
    1. j_1iintnum
    At an Excise group
    1. j_1irg23a1
    2. j_1irg23a2
    3. j_1iRG1
    4. j_1irg23c1
    5. j_1irg23c2
    6. j_1ipla2
    7. j_1iintpr2
    8. j_1irg23d
    9. j_1irg1_t ( material level)
    10. j_1iconpla ( if Consolidated PLA is used )
    At Series group
    1. j_1iexcloc
    2. j_1iexcexp
    3. j_1idepinv
    4. j_1i57Fc ( 57F Challans )
    Rewards if Helpful
    regards
    rb

  • How to use a parameter passed to stored procedure in cursor?

    I am rather new to Oracle stored procedures and I'm sure that
    this is rather simple. Could someone tell me how to do the
    following: I would like to pass the variable status into my
    stored procedure and then use it in the where clause when
    defining my cursor. I have the stored procedure working 100%
    other than this small detail.
    CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
    VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
    VARCHAR2) IS
    BEGIN
    DECLARE
         CURSOR bid_cursor IS
         SELECT bm.hotelid
         FROM dbo.bidmaster bm
         WHERE bm.channelid = cid
         and bm.contractperiod = kperiod
         and bm.bidstatus like '&status'
    END;
    Thank you

    I am rather new to Oracle stored procedures and I'm sure that
    this is rather simple. Could someone tell me how to do the
    following: I would like to pass the variable status into my
    stored procedure and then use it in the where clause when
    defining my cursor. I have the stored procedure working 100%
    other than this small detail.
    CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
    VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
    VARCHAR2) IS
    BEGIN
    DECLARE
         CURSOR bid_cursor IS
         SELECT bm.hotelid
         FROM dbo.bidmaster bm
         WHERE bm.channelid = cid
         and bm.contractperiod = kperiod
         and bm.bidstatus like '&status'
    END;
    Thank you You can do something like this
    CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
    VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
    VARCHAR2) IS
    BEGIN
    DECLARE
    CURSOR bid_cursor (p_status varchar2) IS
    SELECT bm.hotelid
    FROM dbo.bidmaster bm
    WHERE bm.channelid = cid
    and bm.contractperiod = kperiod
    and bm.bidstatus like p_status
    END;
    and then in the BEGIN section do
    open bid_cursor(status)
    This should work.
    Regards
    Manoj

  • Stored procedure with cursor as out parameter

    Can any one help me by showing how to write a procedure with cursor as out parameter and caputuring it in java using jdbc.
    Thanks in advance,
    shravan bharadwaj

    I know that in the SQLJ distribution (which is also downloadable) there is an example in the demo directory called RefCursDemo that shows the SQL code and how to call it - albeit from SQLJ and not JDBC. There may also be a demo in the JDBC distribution, though I am not sure about that.

  • Dynamically calling stored procedure and getting result set c++

    Hello,
    I am trying to write some c++ code that will dynamically bind values to a stored procedure and excute the procedure and get back a resultset. The problem I am running into is how to get back the resultset. Any help or example would be highly appreciated.

    int main(int argc, char* argv[])
    OCIError* pOciError;
    char* pConnectChar = "dbname";
    char* pUsernameChar = "scott";
    char* pPasswordChar = "tiger";
    int answer;
    OCIStmt* pOciStatement;
    char* sqlCharArray = "BEGIN :success := sp_ListEmp; END;";
    int id;
    char ename[40];
    OCIEnv* g_pOciEnvironment = NULL;
    OCIServer* g_pOciServer = NULL;
    OCISession* g_pOciSession = NULL;
    OCISvcCtx* g_pOciServiceContext = NULL;
    sb2* pIndicator=0;
    sb2* pIndicator2=0;
    sb2* pIndicator3=0;
    OCIDefine* pOciDefine;
    OCIDefine* pOciDefine2;
    OCIBind* pBind;
    OCIStmt* cursor;
    answer = OCIInitialize(OCI_THREADED, NULL, NULL, NULL, NULL);
    answer = OCIEnvInit(&g_pOciEnvironment, OCI_DEFAULT, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciSession, OCI_HTYPE_SESSION, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServer, OCI_HTYPE_SERVER, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
    answer = OCIServerAttach(g_pOciServer, pOciError, (unsigned char *)pConnectChar, strlen(pConnectChar),
    OCI_DEFAULT);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pUsernameChar, strlen(pUsernameChar),
    OCI_ATTR_USERNAME, pOciError);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pPasswordChar, strlen(pPasswordChar),
    OCI_ATTR_PASSWORD, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciServer, 0, OCI_ATTR_SERVER, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciSession, 0, OCI_ATTR_SESSION, pOciError);
    answer = OCISessionBegin(g_pOciServiceContext, pOciError, g_pOciSession, OCI_CRED_RDBMS, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&pOciStatement), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray, strlen(sqlCharArray),
    OCI_NTV_SYNTAX, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&cursor), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIBindByPos(pOciStatement,&pBind, pOciError, 1, &cursor, 0,SQLT_RSET,
    pIndicator2, 0,NULL, 0,0,OCI_DEFAULT);
    answer = OCIStmtExecute(g_pOciServiceContext, pOciStatement, pOciError, 1, 0, NULL, NULL,
    OCI_COMMIT_ON_SUCCESS);
    answer = OCIDefineByPos(cursor,&pOciDefine, pOciError,2,&id,sizeof(int),
    SQLT_INT,pIndicator, 0, 0,OCI_DEFAULT);
    answer = OCIDefineByPos(cursor,&pOciDefine2, pOciError,1,ename,40,
    SQLT_STR,pIndicator3, 0, 0,OCI_DEFAULT);
    if (answer == 0)
    while ((answer = OCIStmtFetch(cursor,pOciError, 1,OCI_FETCH_NEXT,OCI_DEFAULT)) == 0)
    printf("fetched id %d and name %s\n",id,ename);
    answer = OCIHandleFree(pOciError, OCI_HTYPE_ERROR);
    return 0;

  • 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

  • Is BC4J a viabl option for database with stored procedure (ref cursor) API?

    I'm about to begin a Web application development project. As foundation, we have a (Oracle) database of certain complexity that have a data access API developed with PL/SQL packages.
    This API is designed to get data through stored procedures/functions that return REF CURSOR.
    Personally I have been investigating about Oracle ADF/JSF, and a number of others J2EE technologies, and at this moment I am doubting if ADF BC are a viable option to my development team.
    I think this because I have noticed that one of the great drawback in ADF BC is the lack of simplicity to get data through stored procedures/functions that returns REF CURSORS.
    I have been looking for documentation and the only thing that I have found are two examples:
    1.- One that really do not work (fails in get data from ref cursor): ADF BC StoredProcedure Sample application.
    2.- And other published by Steve Muench in
    http://radio.weblogs.com/0118231/stories/2003/03/03/gettingAViewObjectsResultRowsFromARefCursor.html. This sample works fine.
    But, the problem with the approach of this last article is the amount (and complexity) of the code necessary to make so basic and recurrent operation as is "obtain data through a stored procedure (ref cursor)".
    Below it is the code that I have constructed to call a function that returns a ref cursor (based on steve's article).
    If this is the only way to make this (historically so basic and simple) task, then it is obvious that BC is not a viable technology to my (or I am in a mistake?), since we have about 50 stored procedures/functions to access the underlying data; that stored procedures/functions are key to development of the new application (and, still more, currently are used to anothers apps ).
    By all this, I would like consult to Oracle's people:
    1.- I really must reject BC as technology to implement this project ?
    2.- It is possible to access stored procedures in a simpler way using BC?
    3.- If the answer to 2 is NOT: in near future, the BC team has plans to give more support to the simple access to stored procedures?
    4.- If the answer to 3 is NOT: what another technology you recommend to construct my data access/business tier and still be able to using the others characteristics of ADF?
    Thank you very much for your guidelines.
    Regards, RL.
    ** And the code!!!
    ** ###   I am forced to do this for each call to a procedure???? ###
    package myrefcursor.model;
    import java.math.BigDecimal;
    import java.sql.CallableStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Types;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.NullValue;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.DBTransaction;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    public class TraePolizasViewImpl extends ViewObjectImpl {
        private static final String SQL = "begin ? := PKG_PRUEBA.trae_polizas(?);end;";
        private static final String COUNTSQL = "begin ? := PKG_PRUEBA.count_trae_polizas(?);end;";
        public TraePolizasViewImpl() {
        protected void executeQueryForCollection(Object qc,Object[] params,int numUserParams) {
            BigDecimal rut_contratante = null;
            Object[] theUserParam = null;
            System.out.println(params);
            System.out.println(params[0]);
            if (params != null)
                theUserParam = (Object[]) params[0];
            //if (theUserParam != null && theUserParam.length > 0 )
            if (! (theUserParam[1]   instanceof NullValue) )
                rut_contratante = (BigDecimal)theUserParam[1];
            storeNewResultSet(qc ,retrieveRefCursor(qc, rut_contratante));
            super.executeQueryForCollection(qc, params, numUserParams);
        protected void create() {
          getViewDef().setQuery(null);
          getViewDef().setSelectClause(null);
          setQuery(null);
        protected ViewRowImpl createRowFromResultSet(Object qc, ResultSet rs) {
          rs = getResultSet(qc);
          ViewRowImpl r = createNewRowForCollection(qc);
          try {
            populateAttributeForRow(r,0, nullOrNewNumber(rs.getBigDecimal(1)));
            populateAttributeForRow(r,1, rs.getString(2));
          catch (SQLException s) {
           throw new JboException(s);
          return r;
        protected boolean hasNextForCollection(Object qc) {
          ResultSet rs = getResultSet(qc);
          boolean nextOne = false;
          try {
            nextOne = rs.next();
            if (!nextOne) {
              setFetchCompleteForCollection(qc, true);
              rs.close();
          catch (SQLException s) {
           throw new JboException(s);
          return nextOne;
        protected void releaseUserDataForCollection(Object qc, Object rs) {
           ResultSet userDataRS = getResultSet(qc);
           if (userDataRS != null) {
            try {    userDataRS.close();    }
            catch (SQLException s) { ; }  
          super.releaseUserDataForCollection(qc, rs);
        public long getQueryHitCount(ViewRowSetImpl viewRowSet) {
          return viewRowSet.getRowCount();
        private ResultSet retrieveRefCursor(Object qc, BigDecimal rut_contratante) {
          CallableStatement st = null;
          try {
            st = getDBTransaction().createCallableStatement(SQL, DBTransaction.DEFAULT);
            st.registerOutParameter(1,OracleTypes.CURSOR);
            if (rut_contratante == null)
                st.setNull(2, Types.NUMERIC);
            else
                st.setBigDecimal(2, rut_contratante);
            st.execute();
            ResultSet rs = ((OracleCallableStatement)st).getCursor(1);
            rs.setFetchSize(getFetchSize());
            return rs ;
          catch (SQLException s) {
            throw new JboException(s);
          finally {try {st.close();} catch (SQLException s) {;}}
        private void storeNewResultSet(Object qc, ResultSet rs) {
          ResultSet existingRs = getResultSet(qc);
          if (existingRs != null) {
            try {existingRs.close();} catch (SQLException s) {;}  
          setUserDataForCollection(qc,rs);
          hasNextForCollection(qc); // Prime the pump with the first row.
        private ResultSet getResultSet(Object qc) {
            return (ResultSet)getUserDataForCollection(qc);
        private static Number nullOrNewNumber(BigDecimal b) {
             try {
               return b != null ? new Number(b) : null;
             catch (SQLException s) { ; }
             return null;
        public BigDecimal getprutcontratante() {
            return (BigDecimal)getNamedWhereClauseParam("prutcontratante");
        public void setprutcontratante(BigDecimal value) {
            setNamedWhereClauseParam("prutcontratante", value);
    }

    no?

  • Regarding Procedures and functions

    can we pass a cursor,table or ref cursor to a procedure and functions and can a function return cursor,table or ref cursor to a procedure and functions?please if possible give some examples with explanations
    thanks in advance..

    Hi,
    The definition for a Procedure or Function can be edited by selecting Edit from the drop-down menu for the Procedure/Function object in the Browser.
    The definition can then be edited as text, and so Table, REF CURSOR, ... parameters or return types can be added.
    (After completing the edit, select Save from the File menu, or alternatively Close the tab displaying the definition and select Yes to the Save Changes dialog.)
    The Oracle Database PL/SQL Language Reference documentation contains some examples of Procedure and Function definitions.
    David

  • Forms Data-Block based on stored procedures - REF CURSOR feature NOT FUNCTIONING

    This topic is related to another topic in this forum titled "FORMS HOW TO SET QUERY SOURCE ARGUMENTS??" I posted my message there as well. I am posting as a NEW TOPIC so that it catches the attention of Oracle Support.
    I built a data form based on a stored procedure and REF CURSOR IN OUT parameter.
    My procedure takes a IN parameter to fill in the criteria for the OPEN <cursor_variable> select ... where ... statement.
    In the Value setting of the Query source Arguments , I set the VALUE to ":BLOCK_NAME.ITEM_NAME" at design time to supply the input value to the procedure. this works to the extent of making available the form item value to the stored procedure parameter. I verified this by doing an insert into some debug table , of the incoming parameter value inside my stored procedure.
    The cursor gets opened properly into the REF cursor variable. I verified this by fetching a record into a local variable and inserting the value into a debug table again in the stored procedure.
    (I took care to close and re-open the REF cursor variable again - so that the front-end can continue to fetch it from the first record. )
    ***** PROBLEM **************
    But the front end forms runtime is giving me a FRM-40301 - query returned no records even though the REF cursor is returned properly opened.
    Did anybody else face the same problem ??
    Please post what you found.
    Thanks,
    Shankaran
    null

    This topic is discussed at length in another thread "How Set Value For Query DataSource Arguments?"
    But I am posting the findings here as well.
    THIS TOPIC IS CLOSED.
    My Bad. The problem Cause : I did not include all columns in the
    cursor rowtype in the Data-block. In the wizard for the data block , I selected ONLY the columns that I needed. But I was doing a Select * from <my_table> in my open cursor <Cursor-Variable> .... The <Cursor Variable>
    itself was declared <my_table>%rowtype
    FIX : The Data Block structure (columns included as items) should match the cursor record Structure. One may or may not
    display all the columns in the LAYOUT though.
    But I don't understand why it gives such a misleading message like FRM-40301 Query retrieved no records. Oracle Team fix it.
    Hope this helps people who face the same problem.
    Thanks,

  • SPL determination procedure and  control procedure

    Hello all
    Can someone help me in understanding what  a determination procedure and a control procedure means during SPL screening  ? How these two are linked , during "configuring the SPL check algorithm" .?
    How is the spl determination procedure is linked to the document type ? ( As i see that there are already standard determiantion procedures for each service eg:   1 : lespl for SPL check
    2: leldt for licence det ..... etc 
    when a document is sent from R/3 to GTS how does the system identifies the procedure that it has to go with ?   for eg lespl or leldt..
    Thanks alot ..

    Hi
    Det Procedure
    We define the Det procedures  to use to determine the active legal regulations for a particular service like SPL. We define the determination stratgey for Det proc. to determine the Leg reg.
    Control Procedure  for Address comparison:
    We  define a control procedure to determine the rules according to which the system performs sanctioned party list (SPL) checks, this tell what exact detail has to be chekced for SPL like name , city and so  on in an address and set rule for how the string of address will be checked against SPL data.
    How is the spl determination procedure is linked to the document type ? ( As i see that there are already standard determiantion procedures for each service eg: 1 : lespl for SPL check
    2: leldt for licence det ..... etc
    Ans :
    SPL det Proc determines the Leg reg which can be for SPL or Embargo . And for each service we  like SPL  we have document type activated this was Det Proc get related to Doc type.
    when a document is sent from R/3 to GTS how does the system identifies the procedure that it has to go with ? for eg lespl or leldt..
    Ans:
    Each doc type coming from a Feeder system is assigned to Document type defined and activated for a particualr service like SPL , and also we actiavte Det Proc separatley for eac servces like SPL.
    When ever a doc comes to GTS it get determined to which  GTS doc type it is assigned and that  then it is determined under what service that GTS doc type is defined.
    Suppose OR is assigned to EXORD1 ( GTS doc type) and this doc type comes under SPL so now the configuration for SPL will have particualr Det Procedure actiavted.
    Hope this helps
    Kind Regards,
    Sammer

  • Please Help!!! error executing procedure and populating to gridview

    I have used a tool to convert my sql 2000 stored procedure to Oracle 10g PL/SQL, here is an example
    SQL 2000 Stored Procedure
    CREATE PROCEDURE [GetEmployees]
    AS
    Select * from EMPMST ORDER BY emp_name
    GO
    After Transformation i got 2 files, one was a procedure and other a package
    CREATE OR REPLACE PACKAGE GLOBALPKG
    AS
         TYPE RCT1 IS REF CURSOR;
         TRANCOUNT INTEGER := 0;
         IDENTITY INTEGER;
    END;
    CREATE OR REPLACE PROCEDURE GetEmployees
         RCT1 IN OUT      GLOBALPKG.RCT1
    AS
    BEGIN
         OPEN RCT1 FOR
         SELECT *
         FROM EMPMST
         ORDER BY emp_name;
    END;
    When i execute the procedure GetEmployees i got this error :
    SQL> execute GetEmployees;
    BEGIN GetEmployees; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GETEMPLOYEES'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I am developing a webpage (asp.net using Visualstudio .net 2005 ) where i have a grid view in which i want to display all the output of the GetEmpoyee procedure but it is giving an error.
    Please Help me in debugging this error. Thanks in advance.

    Hi Pruthvi,
    It seems to me the convertion is correct. You need a REF CURSOR and by the Stored Procedure itself without using Package the REF CURSOR cannot specify as OUT output parameter.
    You can use SQL Developer to help you to make sure you put the Package in the right Database Schema.
    http://otn.oracle.com/sqldeveloper
    After you converted the Stored Procedure you need to modify your .NET code as well. The .NET code that calls your old MS SQL Stored Procedure will not work. To see how to involve the REF CURSOR in .NET you can check here:
    http://blogs.oracle.com/MingMan/stories/storyReader$9
    Good Luck
    Ming Man

  • How to test PL/SQL procedures and functions?

    What are the proven ways to test pl/sql procedures and functions? Specifically, procedures and functions that take cursor variables as IN OUT parameter, OR procedure and functions that takes an array as IN parameter?
    Thx.

    HI,
    One way could by using PL/SQL Develper tool, see Tools/Test Manager...
    Also there are others tools, see [Cleaning Up PL/SQL Practices|http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_plsql.html] and specifically oUnit
    Regards,
    PS: Your question is very general, could you provide an specific example you are trying?
    Edited by: Walter Fernández on Nov 11, 2008 4:04 PM - Adding PS

Maybe you are looking for

  • Can't eject card reader!

    Greetings, I have a compact flash card reader (USB 2) that i plugged into the USB slot on the front of my MacPro. I copied the wanted photos over to my hard drive, used the "eject" button from the Finder window to eject the card reader.... and it dis

  • IPad (3rd gen) losing wifi connection during BBC iPlayer downloads

    Hi, I am having a strange, app-specific problem with my iPad 3rd generation (wifi only, 64GB) running iOS 6.1.3. When I use the BBC iPlayer app (version 2.0.5.33) to download a TV show to watch offline, my iPad almost always loses wifi connection a m

  • Serverside response for spry rating

    first off, where is the best place to post spry questions? I am building a spry rating widget using the dynamic sample from the spry documentation: http://labs.adobe.com/technologies/spry/articles/rating_overview/index.html I understand how to send t

  • I can't see the Copy dialog box - ideas?

    Yep, it's as simple as that. When I copy something, I can't see the dialog box showing the progress of the copy/move/etc. In the Window menu, it shows that there's a copy dialog open, but I just can't see it.  It's not on another desktop or in a corn

  • How to transfer PS Elements 3 catalog to PSE10

    I have a new computer and have installed Photoshop Elements 10. Can I transfer my PSE 3 catalog to the new computer?