DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Cursor Error - This is only place to come to.

  1. #1
    Join Date
    Nov 2001
    Posts
    55
    PROCEDURE GetMatchingAssays ( InASSAYStru IN assay_struct,
    InAryAssayRESULTTYPE IN vAryAssay_result_type,
    InAssayAttributeAry IN vAryAssay_attribute,
    InAryAssay_attribute_value IN vAryAssay_attribute_value,
    LevelOfChecking IN CHAR,
    ASSAY_cur OUT AIMASSAY_cur) IS
    idx SMALLINT;
    AssayIds vAryAssayId;
    BEGIN
    IF InASSAYStru.Assay_class IS NOT NULL THEN
    OPEN ASSAY_cur FOR
    SELECT ASSAY_ID FROM ASSAY
    WHERE ASSAY_CLASS = InASSAYStru.Assay_class;
    idx := 1;
    FOR ASSAYRec IN ASSAY_cur
    LOOP
    AssayIds(idx) := ASSAYRec.ASSAY_ID;
    END LOOP;
    END IF;
    END GetMatchingAssays ;

    when compiling this procedure I am getting an error,

    Warning: Package Body created with compilation errors.

    Errors for PACKAGE BODY AIMADS_PACK:

    LINE/COL ERROR
    -------- -----------------------------------------------------------------
    1259/3 PL/SQL: Statement ignored
    1259/19 PLS-00221: 'ASSAY_CUR' is not a procedure or is undefined

    Warning: Package Body created with compilation errors.

    I cannot put open cursor stmt before begin coze, I am going to create cursor in a for loop and close it after processing,

    Please help me

    ThanX
    Raj

  2. #2
    Join Date
    Mar 2001
    Location
    Reading, U.K
    Posts
    598
    HI,
    FOR THIS U GOTO USE REF CURSOR.

    U HV 2 CREATE A REF CURSOR AND USE THAT HERE
    THNX,
    Cheers!
    OraKid.

  3. #3
    Join Date
    Nov 2001
    Posts
    55
    Sorry balajiyes not being clear, I will not pass this cursor to calling program, I will process this cursor in the same procedure.

  4. #4
    Join Date
    Jan 2002
    Posts
    33
    What balajiyes is saying is that in your package spec,
    put something like:
    create or replace package GetMatchingAssays_PB as
    type AIMASSAY_cur is REF CURSOR;
    then when you put this:
    ASSAY_cur OUT AIMASSAY_cur in your procedure in package body, your code will work.
    If you still don't get it. post the entire package including package spec and we can help you then.

  5. #5
    Join Date
    Nov 2001
    Posts
    55
    Problem Solved.

    ThanX
    Raj

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