Executing SELECT statement with hardcoded values depending on conditions
768220Apr 21 2010 — edited Apr 23 2010Hi 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