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

Thread: External Cursor

  1. #1
    Join Date
    Dec 1999
    Location
    Alpharetta, GA, US
    Posts
    192
    I would like to know why the cursor is failling after it select couple of records.
    --------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE sp_test_cursor( i_input in number)
    IS
    v_msisdn varchar2(11);
    CURSOR cur_npa_split IS SELECT lmsisdn FROM customer;

    BEGIN
    -- Open
    OPEN cur_npa_split;
    LOOP
    FETCH cur_npa_split
    INTO v_msisdn;

    EXIT WHEN cur_npa_split%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE('MSISDN='||v_msisdn);
    END LOOP;
    -- Close
    CLOSE cur_npa_split;
    COMMIT;

    EXCEPTION
    WHEN DUP_VAL_ON_INDEX THEN
    RAISE_APPLICATION_ERROR(-20518,
    'Duplicate Value on Index...');
    WHEN NO_DATA_FOUND THEN
    RAISE_APPLICATION_ERROR(-20519,
    'No_Data_Found Occur...');
    WHEN TOO_MANY_ROWS THEN
    RAISE_APPLICATION_ERROR(-20520,
    'Select Too Many Rows...');
    WHEN OTHERS THEN
    RAISE_APPLICATION_ERROR(-20521,
    'UN-NONE ERROR Occur...');
    END sp_cnot_sync_cursor;
    /

    ERROR:
    MSISDN=6784311664
    BEGIN sp_cnot_sync_cursor(1); END;

    *
    ERROR at line 1:
    ORA-20521: UN-NONE ERROR Occur...
    ORA-06512: at "SYNCMIN.SP_CNOT_SYNC_CURSOR", line 41
    ORA-06512: at line 1

    ----------------------------------------------
    Thanks
    Chandra

  2. #2
    Join Date
    Feb 2001
    Posts
    180
    First try to fetch the error like:
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE(SQLERMM);
    RAISE_APPLICATION_ERROR(-20521,
    'UN-NONE ERROR Occur...');
    Regards
    Ben de Boer

  3. #3
    Join Date
    Dec 1999
    Location
    Alpharetta, GA, US
    Posts
    192
    It's working.

    Thank You very much.

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