Home » Developer & Programmer » Forms » How can a variable (which contain the column name) as a column in select clause (oracle developer, 6i, xp)
How can a variable (which contain the column name) as a column in select clause [message #305094] Sat, 08 March 2008 07:03 Go to next message
zawar
Messages: 2
Registered: June 2007
Location: Pakistan
Junior Member

hi all,
i want to get the value of dynamic columns from a table where the value of the variable changes dynamically,

to assigning value to variable can i use it in select clause
i.e

declare
temp varchar2(30);
begin
-- assigning value to temp variable
select column_name into temp from user_tab_columns
where table_name = 'EMP' and column_id = 2;
-- using temp variable in select clause
select TEMP into :employee_name from emp;
end;

please help me
Re: How can a variable (which contain the column name) as a column in select clause [message #305110 is a reply to message #305094] Sat, 08 March 2008 10:16 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Which version of forms you are using?
Use dynamic sql.

By
Vamsi
Re: How can a variable (which contain the column name) as a column in select clause [message #305226 is a reply to message #305110] Mon, 10 March 2008 03:30 Go to previous message
zawar
Messages: 2
Registered: June 2007
Location: Pakistan
Junior Member

i m using form developer 6i
database oracle 9i
os xp
Previous Topic: how to change the value of Record Group at run time
Next Topic: Trimming spaces
Goto Forum:
  


Current Time: Sat Dec 10 07:13:46 CST 2016

Total time taken to generate the page: 0.04420 seconds