Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Inline Views be used by Normal cursor

856991May 18 2012 — edited May 20 2012
Hi All,

Can anyone of you please let me know if an inline view can be used for a cursor.

I tried using as below, but the cursor is not able to fetch the records.

cursor c1 is
select * from
(select gretest(a, b, c ,d) start_date, least(e,f,g,h) end_date from t1, t2,
where t1.col1= t2.col3
group by a,b,c,d
)
where start_date < end_date
Order by end_date asc

when the cursor is getting opened, it is getting exited as there are no records.

But if i try to run the same query which is written for the cursor i.e

select * from
(select gretest(a, b, c ,d) start_date, least(e,f,g,h) end_date from t1, t2,
where t1.col1= t2.col3
group by a,b,c,d
)
where start_date < end_date
Order by end_date asc

Query is returning rows. But Within Cursor, it is not working

Also, please let me know if we need to use REF cursor for this purpose and if REF cursor allows Bulk fetch ?

Thanks,
Lakshmi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 17 2012
Added on May 18 2012
8 comments
848 views