Home » Developer & Programmer » Forms » Help to use nested name_in function in oracle forms 6i (Forms 6i)
Help to use nested name_in function in oracle forms 6i [message #504654] Wed, 27 April 2011 02:14 Go to next message
eng_amrelhanafy
Messages: 5
Registered: October 2010
Location: Egypt
Junior Member
I have a for loop cursor , I want to use name in with it .


Example :

Create table a (a1 varchar2(10) , a2 varchar2(10) ) ;
insert into a values ( 'aa' , 'bb');


I have an item that contains the column name , lets say its :col_name which equals 'a1' ;
for i in (select * from a) loop
  message('The content of a1 is '||name_in('i.'||name_in('col_name')));
end loop;



the message appears ----> The content of a1 is a1

the outer name in function doesn't work , the inner one works well.

Is this function not working with cursors , and is there is any alternative solutions for the previous case ??

Thank you
Re: Help to use nested name_in function in oracle forms 6i [message #504663 is a reply to message #504654] Wed, 27 April 2011 03:33 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I suspect name_in can't work on records.
If you've only got two columns just use an IF statement.
Re: Help to use nested name_in function in oracle forms 6i [message #504670 is a reply to message #504663] Wed, 27 April 2011 04:04 Go to previous messageGo to next message
eng_amrelhanafy
Messages: 5
Registered: October 2010
Location: Egypt
Junior Member
Unfortunately , I don't have only two records . Its just a sample
I want to specify table name , some colums of that table as parameters . Then pass these parameters to the previous code .
Re: Help to use nested name_in function in oracle forms 6i [message #504672 is a reply to message #504670] Wed, 27 April 2011 04:24 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then you'll have to use full dynamic sql - read up on execute immediate. I suspect you need to rethink the design.
Re: Help to use nested name_in function in oracle forms 6i [message #504675 is a reply to message #504672] Wed, 27 April 2011 04:55 Go to previous message
eng_amrelhanafy
Messages: 5
Registered: October 2010
Location: Egypt
Junior Member
Thank you ,
but I hope there is another solution equivalent to name_in with records
Previous Topic: i need help
Next Topic: Add Sub Form to a Form
Goto Forum:
  


Current Time: Mon Sep 16 21:22:20 CDT 2024