Dynamically call column in Select Statement [message #195138] |
Wed, 27 September 2006 02:52 |
fahedakhter
Messages: 39 Registered: March 2005 Location: Pakistan
|
Member |
|
|
I have 3 columns in table like "PRO_LOC,WVG_LOC,STH_LOC".I want to select my dsired column on condition
:Global.V_Menu kept following values ('PRO','WVG','STH').
I have made this query and its work fine but it is hardcoded "PRO,WVG,STH").
SELECT DECODE(:Global.V_Menu, 'PRO', Pro_Loc, 'WVG', Wvg_Loc, 'STH', Sth_Loc)
FROM My_Table;
I Want my query like this.
SELECT :Global.V_Menu||'.Loc'
FROM My_Table;
Does it possible or not.
Reagrs'd
Fahed
|
|
|
|
|