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 8853823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:44:33+00:00 2026-06-14T13:44:33+00:00

am writing procedure in pl/sql. when i run the procedure am getting error.Here i

  • 0

am writing procedure in pl/sql. when i run the procedure am getting error.Here i enclosed the procedure.

code

PROCEDURE get_CDR_rs_phone (CDR_recordset OUT SYS_REFCURSOR)AS 
BEGIN 
  OPEN CDR_recordset FOR
   SELECT  zkv.CISCOCUIC_TBL.FLD_callingPartyNumber FROM  zkv.CISCOCUIC_TBL; 

END get_CDR_rs_phone;
/

getting error when i run this proc
  • 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-06-14T13:44:34+00:00Added an answer on June 14, 2026 at 1:44 pm

    Create your procedure as

    CREATE OR REPLACE PROCEDURE get_cdr_rs_phone (
        cdr_recordset    OUT sys_refcursor
    )
    AS
    BEGIN
        OPEN cdr_recordset FOR
            SELECT  zkv.ciscocuic_tbl.fld_callingpartynumber
              FROM  zkv.ciscocuic_tbl;
    END get_cdr_rs_phone;
    /
    

    and execute your procedure

    variable r refcursor;
    
    DECLARE
    
    BEGIN
    
      get_cdr_rs_phone (:r);  
    END;
    /
    
    print r
    

    Update 1

    If your procedure is doing only a select you could do this using a function which return sys_refcursor and the function can be executed from a sql statement.

    Create function as

    CREATE OR REPLACE FUNCTION get_cdr_rs_phone_func
        RETURN sys_refcursor
    AS
        out_cursor   sys_refcursor;
    BEGIN
        OPEN out_cursor FOR
              SELECT    zkv.ciscocuic_tbl.fld_callingpartynumber
                  FROM  zkv.ciscocuic_tbl;
        END get_cdr_rs_phone;
    
        RETURN out_cursor;
    EXCEPTION
        WHEN NO_DATA_FOUND
        THEN
            --raise error
    
        WHEN OTHERS
        THEN
            --raise error
    
    END get_cdr_rs_phone_func;
    /
    

    and call this function as

    select get_cdr_rs_phone_func from dual;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing Perl regex code to separate out PL/SQL procedure from the package.
I am writing a stored procedure in SQL Server 2008. Here I have a
I am writing a PL/SQL Procedure that performs a select based on input variables
I am using SQL Server. I'm writing a stored procedure that executes a series
I'm writing a stored procedure on SQL Server 2000. I've written a complicated select
I'm writing a stored procedure in SQL Server 2008, interatively. When using SQL Server
Writing my first SQL query to run specifically as a SQL Job and I'm
please help me with writing this search sql stored procedure procedure may have different
Possible Duplicate: TSQL Writing into a Temporary Table from Dynamic SQL ALTER PROCEDURE [dbo].[usp_ServicesStats1](@PERIOD
When writing a procedure in PL/SQL, I can declare a parameter's type as myTable.myColumn%TYPE

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.