Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 644405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:23:14+00:00 2026-05-13T21:23:14+00:00

I am using Oracle SQL Developer, but I am having an issue seeing results

  • 0

I am using Oracle SQL Developer, but I am having an issue seeing results from a package that returns a ref cursor. Below is the package definition:

CREATE OR REPLACE package instance.lswkt_chgoff_recov
as
      type rec_type is record
            (
            source_cd                       lswk_tpr.gltrans.tpr_source_cd%TYPE,
            as_of_dt                        lswk_tpr.gltrans.tpr_as_of_dt%TYPE,
            chrg_off_recov                  varchar2(5),
            process_dt                      lswk_tpr.gltrans.dtgltran%TYPE,
            effect_dt                       lswk_tpr.gltrans.dtgltran%TYPE,
            account_nbr                     lswk_tpr.contract.lcontid%TYPE,
            naics_cd                        lswk_tpr.udfdata.sdata%TYPE,
            prod_type                       varchar2(20),
            off_nbr                         lswk_tpr.schedule.sctrcdty%TYPE,
            borrower_nm                     lswk_tpr.customer.scustnm%TYPE,
            tran_type_cd                    lswk_tpr.gltrans.sglcd%TYPE,
            tran_type_desc                  lswk_tpr.gltrans.sglcd%TYPE,
            tran_amt                        lswk_tpr.gltrans.ctranamt%TYPE,
            note_dt                         lswk_tpr.schedule.dtbk%TYPE,
            accru_cd                        number,
            non_accr_cd                     lswk_tpr.schedule.dtlstincsus%TYPE,
            comm_sb_ind                     varchar2(4)
            );

      type cur_type is ref cursor return rec_type;

      procedure sp
            (
            p_as_of_dt              in      date,
            ref_cur                 in out  cur_type
            );
end;
/

I guess the question is this possible and if so, what do I need to do. I am using Oracle SQL Developer 1.5.5. Thanks.

Wade

Here is the code I used to call my package (generated by TOAD):

DECLARE 
  P_AS_OF_DT DATE;
  REF_CUR instance.LSWKT_CHGOFF_RECOV.CUR_TYPE;
  REF_CUR_row REF_CUR%ROWTYPE;

BEGIN 
  P_AS_OF_DT := '31-AUG-2009';

  instance.LSWKT_CHGOFF_RECOV.SP ( P_AS_OF_DT, REF_CUR );

  DBMS_OUTPUT.Put_Line('REF_CUR =');
  IF REF_CUR%ISOPEN THEN
  DBMS_OUTPUT.Put_Line('  SOURCE_CD  AS_OF_DT  CHRG_OFF_RECOV  PROCESS_DT  EFFECT_DT  ACCOUNT_NBR  NAICS_CD  PROD_TYPE  OFF_NBR  BORROWER_NM  TRAN_TYPE_CD  TRAN_TYPE_DESC  TRAN_AMT  NOTE_DT  ACCRU_CD  NON_ACCR_CD  COMM_SB_IND');
    LOOP
      FETCH REF_CUR INTO REF_CUR_row;
      EXIT WHEN REF_CUR%NOTFOUND;
      DBMS_OUTPUT.Put_Line(
           '  ' || '[TPR_SOURCE_CD%type]'
        || '  ' || '[TPR_AS_OF_DT%type]'
        || '  ' || '''' || REF_CUR_row.CHRG_OFF_RECOV || ''''
        || '  ' || '[DTGLTRAN%type]'
        || '  ' || '[DTGLTRAN%type]'
        || '  ' || '[LCONTID%type]'
        || '  ' || '[SDATA%type]'
        || '  ' || '''' || REF_CUR_row.PROD_TYPE || ''''
        || '  ' || '[SCTRCDTY%type]'
        || '  ' || '[SCUSTNM%type]'
        || '  ' || '[SGLCD%type]'
        || '  ' || '[SGLCD%type]'
        || '  ' || '[CTRANAMT%type]'
        || '  ' || '[DTBK%type]'
        || '  ' || NVL(TO_CHAR(REF_CUR_row.ACCRU_CD), 'NULL')
        || '  ' || '[DTLSTINCSUS%type]'
        || '  ' || '''' || REF_CUR_row.COMM_SB_IND || '''');
    END LOOP;
  ELSE
    DBMS_OUTPUT.Put_line('  (Ref Cursor is closed)');
  END IF;


  COMMIT; 
END;

I get the error:

ORA-06502: PL/SQL: numeric or value error

Hope this clears it up a bit more.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:23:14+00:00Added an answer on May 13, 2026 at 9:23 pm

    You can easily print the output results of a ref_cursor in SQL Developer to see the return value..

    Here’s an example of a Refcursor Function:

    create or replace function get_employees() return sys_refcursor as
      ret_cursor sys_refcursor;
    begin
      open ret_cursor for
        select * from employees;
      return ret_cursor; 
    end get_employees;
    

    Quick and dirty method:

    select get_employees() from dual; 
    

    Neat and tidy method:

    variable v_ref_cursor refcursor;
    exec :v_ref_cursor := get_employees(); 
    print :v_ref_cursor
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm debugging an Oracle package using PL/SQL developer, but I'm running into a problem
I'm writing code using Oracle SQL Developer. I have a simple select statement that
I'm trying to import some data (using oracle sql developer) from a .csv file
I am using Oracle Sql Developer I have a huge script that creates tables,
I'm having difficulty debugging triggers in Oracle. Currently I'm using Oracle's Sql Developer tool.
I'm using Oracle SQL Developer to query an Oracle DB (not sure which version
I'm using Oracle SQL Developer. I'd like to key in dates with hours and
I'm quite new to PL/SQL, and am using Oracle SQL Developer to write a
I'm using oracle 11g sql developer I have a varchar2 column with dates as
I am using Oracle SQL Developer in a linux environment to connect to an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.