Home » Developer & Programmer » Forms » Dynamically assign value to an item in a block (windows xp)
Dynamically assign value to an item in a block [message #283725] Wed, 28 November 2007 01:00 Go to next message
skpiocl
Messages: 3
Registered: November 2007
Location: barauni
Junior Member
Hi All !
I am working in Forms 9i. The application in which I am having problem has a block ( say b1) and it has 3 items say item10 , item11 , item12 . Now, based on a database query, I want to assign a value to one of the items. How to do that.

I am trying to do :b1.item||v_value ( v_value is a variable string based on a query and can have a value 10 , 11 or 12)
But it is giving error.

I am new to developer. Please help me get over this problem

Thanks.
Re: Dynamically assign value to an item in a block [message #283731 is a reply to message #283725] Wed, 28 November 2007 01:04 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Please write the query that is give the error along with the error.
Re: Dynamically assign value to an item in a block [message #283749 is a reply to message #283731] Wed, 28 November 2007 01:36 Go to previous messageGo to next message
skpiocl
Messages: 3
Registered: November 2007
Location: barauni
Junior Member
Thanks,

My code is something like this

declare
v_value number;

begin
v_value := ---> get some value thrugh SQL.
:b1.item||v_value := 's' ;
end;

error is :b1.item||v_value is bad bind variable
Re: Dynamically assign value to an item in a block [message #283791 is a reply to message #283749] Wed, 28 November 2007 02:54 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Dear you cann't assign a value to two concatinated variables like this....
:b1.item||v_value := 's';

You can do it like this

v_value := b1.item||v_value||'s';

OR

v_new_var := := b1.item||v_value||'s';


Regards,
Azam Khan
Re: Dynamically assign value to an item in a block [message #283805 is a reply to message #283791] Wed, 28 November 2007 03:22 Go to previous message
skpiocl
Messages: 3
Registered: November 2007
Location: barauni
Junior Member
Thanks for you help Azam. My Problem is solved.
Previous Topic: Run a procedure in a form
Next Topic: LOV's decription fail's to increase.
Goto Forum:
  


Current Time: Sat Dec 10 08:51:28 CST 2016

Total time taken to generate the page: 0.08752 seconds