Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can and open a ref cursor to have r

Status
Not open for further replies.

Darshu

Programmer
Jul 25, 2006
21
0
0
US
can and open a ref cursor to have records for two conditions?
meaning
refc1 is my refcursor
if contition then
open refc1 for ----
else
open refc1 for --
end if
how can i do this and also
can i open ref cursor for insert statment and update statment
please give example


 
Ref cursors aren't designed for update or insert statements but you can do these using syntax such as:

execute immediate 'update table_a set x=y where a=b';

You use ref cursors as follows:

declare
type t_curs is ref cursor;
v_curs t_curs;
begin
if condition1 then
open v_curs for 'select x,y,z from tablea';
else
open v_curs for 'select x,y,z from tableb';
end if;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top