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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTERNATIVE TO CASE IN ORACLE-CURSORS

Status
Not open for further replies.

sreenathkm

IS-IT--Management
Jan 22, 2002
12
0
0
US
Hi Can any one suggest me a alternative to CASE, as I relaised that I cant use CASE in a Cursor..

Any immediate help will be highly appreciated.

Thanks in advance
 
I guess you are try to use a Case because you need to use <= or >= or < or >.

Let me know if that is the reason!!.
Alexander
 
I am trying to make some conditional selects using CASE where my output also have to be changing accordingly

Thanks for replying
 
Create a stage table and the open that as a cursor.

ex.

INSERT INTO STG_TABLE
SELECT a, b, CASE ....END from table_a

DECLARE
CURSOR X IS SELECT * FROM STG_TABLE

hope this helps
 
You may try DECODE function. Or use DYNAMIC SQL (ref cursor). It should work.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top