Using Cursor in PL/SQL store procedure
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Using Cursor in PL/SQL store procedure

  1. #1
    Join Date
    Mar 2014
    Posts
    1

    Using Cursor in PL/SQL store procedure

    Hi

    I have some problem using cusor in plsql store procedure. Could someone please help me to correct my script? Any suggestion and idea would be appreciated.

    My script is as below

    CREATE OR REPLACE PROCEDURE tAPPOINT
    (
    XFILE IN VARCHAR2, c1 out ref_cursor
    ) as


    BEGIN

    open c1 for ' select * from ' || xfile || ' WHERE FPT=F';

    execute immediate 'update ' || xfile || ' set apptgrp=null';
    commit;
    execute immediate 'update ' || xfile || ' set apptgrp=46' || 'where reptrc=6269' || 'and og=trim(0||6)' || 'and trim(a_jc)=2876';
    commit;
    end tAPPOINT;
    /

    If I take out the high lighted area, my script successfully executed. Otherwise I keep getting error as below.

    begin TAPPOINT('PAYHR'); end;

    ORA-06550: line 1, column 7:
    PLS-00905: object TEST.TAPPOINT is invalid
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored


    Please help to correct this.
    Thank you in advance

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,477

    Cool

    . . .
    If I take out the high lighted area, my script successfully executed. Otherwise I keep getting error as below.

    begin TAPPOINT('PAYHR'); end;
    You are missing the "C1" parameter:
    Code:
    -- - - - - Here - - - +
    -- - - - - - -  - - - V
    begin TAPPOINT('PAYHR'); end;
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width