Home » SQL & PL/SQL » SQL & PL/SQL » Ref Cursor in Select statement-URGENT
Ref Cursor in Select statement-URGENT [message #1408] Fri, 26 April 2002 09:51 Go to next message
UmaSund
Messages: 22
Registered: February 2002
Junior Member
Hi

1.Can i use a ref cusror in a select statement?

2.If yes can some one give me a small example.

Thanks in advance
-Umasund
Re: Ref Cursor in Select statement-URGENT [message #1420 is a reply to message #1408] Sun, 28 April 2002 08:23 Go to previous messageGo to next message
sokeh
Messages: 77
Registered: August 2000
Member
CREATE OR REPLACE PACKAGE GT_REF_PB AS
Type Ref_Cur_Type is Ref Cursor;

Procedure Gt_Ref (P_Ref_Cur_CV OUT Ref_Cur_Type);

END Gt_Ref_PB;
/

CREATE OR REPLACE PACKAGE GT_REF_PB
Type Ref_Cur_Type is Ref Cursor;

Procedure Gt_Ref (P_Ref_Cur_CV OUT Ref_Cur_Type)

IS
BEGIN
/* Cursor Declaration */
Open P_Ref_Cur_CV FOR
SELECT COLUMN1, COLUMN2, COLUMN3
FROM YOUR_TABLE
WHERE 'WHERE_CLAUSE';
END GT_REF;
END GT_REF_PB;

This is as basic as it gets and hope it helps
What is a ref cursor? [message #1867 is a reply to message #1408] Thu, 06 June 2002 05:06 Go to previous message
Ranganath
Messages: 2
Registered: June 2002
Junior Member
Hi,
I am very new to Oracle, I m being intoduced to its functionalities gradually. Now I have found that one of the stored procedures in my DB has a output of the type ref cursor. Kindly tell me more about what a ref cursor is? and what could be its equivalent in SQL Server (if any).
Kindly reply
Thanks in advance for the help.

Ranga
Previous Topic: increment rowcount with each value retreived for a main column
Next Topic: How to use Word in a From?
Goto Forum:
  


Current Time: Fri Apr 26 17:36:44 CDT 2024