Home » Developer & Programmer » Forms » Where clause for the block (form 6i)
Where clause for the block [message #472998] Wed, 25 August 2010 05:51 Go to next message
Amar_bu
Messages: 32
Registered: July 2010
Location: riyadh
Member
I want to set the block where clause to retrieve the data for the task id where the user is authorized and have the laundry_Code

I use the following statement but i am getting an error un handle exception
v1:='(select task_id from ld_task where laundry_code in (select laundry_code from ld_user where upper(user_name)=upper(user) and upper(authorized)=''Y''))' ;
set_block_property('ld_task',default_where,'task_id = v1');


Re: Where clause for the block [message #473001 is a reply to message #472998] Wed, 25 August 2010 06:05 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Thats because you've set the where clause to be
task_id = v1

Rather than
task_id = (select task_id from ld_task 
           where laundry_code in (select laundry_code from ld_user where upper(user_name)=upper(user) and upper(authorized)='Y'))


Anything in quotes is text, not a variable reference.
This is what you want:
set_block_property('ld_task',default_where,'task_id = '||v1);
Previous Topic: To quit from the form with items having Primary Key
Next Topic: Runing Report
Goto Forum:
  


Current Time: Fri Sep 20 02:32:25 CDT 2024