dbTalk Databases Forums  

Ref Cursor Question

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Ref Cursor Question in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mtek
 
Posts: n/a

Default Ref Cursor Question - 09-12-2008 , 02:36 PM






Hi,

I'm new to ref cursors. Please look at this:

TYPE select_cursor IS REF CURSOR;
v_data_crs SELECT_CURSOR;
v_data_rec DATA_CRS%ROWTYPE;


IF p_daily_pass = 'N' THEN
OPEN v_data_crs FOR
'SELECT p.code, p.type, p.subproduct_id, NULL
FROM order_line ol, product p
WHERE ol.product_id = p.product_id
AND ol.order_item_id = _order_item_id'
USING p_order_item_id;
ELSE
OPEN v_data_crs FOR
'SELECT p.code, p.type, p.subproduct_id, co.customer_id
FROM product.newsletter_subscr_features ns, product p,
order_line ol, customer_order co
WHERE is_daily_pass = ''Yes''
AND autorenew = ''No''
AND ns.code = p.code
AND p.product_id = ol.product_id
AND ol.order_id = co.order_id'
AND ol.status IN ('Active','Pending');
END IF;

FETCH v_data_crs INTO v_data_rec;
..
..
..

What is wrong here? I'm going to open up a number of possible
cursors based on some parameters. So, I thought you define the
cursor, then define a type of that ref cursor, then you can define a a
row of that......

Probably pretty simple what I ask.......but help is appreciated.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.