Skip to Main Content

Oracle Database Discussions

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!

Executing SELECT statement with hardcoded values depending on conditions

768220Apr 21 2010 — edited Apr 23 2010
Hi i am writing a pl/sql code. I am very new to this.
I need to execute a select query as follows

Eg:-

select a,b,X from tab

where a,b are table columns. But 'X' is not a table column.
X needs to be hardcoded with value= 'YES' if Flag = A and X ='NO' If Flag ='B'

I am using a Cursor to get the populated values. The cursor should populate the value of 'X' as 'YES' or 'NO' depending on the Flag settings.

This is the logical code-->

CURSOR CURR is
select a,b,'YES' AS X or 'NO' AS X
FROM tab

Please help me on this.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2010
Added on Apr 21 2010
6 comments
11,655 views