Home » Developer & Programmer » Forms » Set_block_property Default Where (6i)
Set_block_property Default Where [message #506768] Wed, 11 May 2011 03:51 Go to next message
kame
Messages: 69
Registered: July 2009
Member
I need some information regarding
SET_BLOCK_PROPERTY , DEFAULT_WHERE
How it works

I am using this code
SET_BLOCK_PROPERTY('bank_recon', 
	DEFAULT_WHERE, 'v_bankcode= ''' || :button.bankcode	|| ''' and ' || 'v_chq= ''' || :button.chq_no || '''');



but when I add one another condition its not working.
SET_BLOCK_PROPERTY('bank_recon', 
	DEFAULT_WHERE, 'v_bankcode= ''' || :button.bankcode	|| ''' and ' || 'v_chq= ''' || :button.chq_no ||
					 ''' and ' || 'recon is null'||
	  '''');


Please guide me and inform me how it is work... how to use ' '
Re: Set_block_property Default Where [message #506769 is a reply to message #506768] Wed, 11 May 2011 04:08 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
As always the standard method of debugging dynamic sql (as this is dynamic sql) should be used.
Assign the value you're passing to set_block_property for the where clause to a variable. Use the message built-in to display the variable (or assign it to a datablock item if you want to be able to copy and paste it).
The problem should become obvious.
Re: Set_block_property Default Where [message #506862 is a reply to message #506768] Wed, 11 May 2011 08:40 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
and recon is null does not need any fancy pipe symbols, and it looks like you are adding way to many single quotes at the end of the clause, since the last part is not a variable.
Re: Set_block_property Default Where [message #507039 is a reply to message #506768] Thu, 12 May 2011 05:13 Go to previous messageGo to next message
jademad
Messages: 8
Registered: May 2011
Location: Bahrain
Junior Member
kame wrote on Wed, 11 May 2011 11:51
I need some information regarding
SET_BLOCK_PROPERTY , DEFAULT_WHERE
How it works

Please guide me and inform me how it is work... how to use ' '


as u know that u can add a where condition to filter any SQL result, u can use where property related to the datablock in the form to set a condition to filter these records that may displayed by using 'WHERE Property'.

Also at the runtime you can set a Where condition for a block using the built-in 'Set_block_Property' as follows:

Set_block_Property ('Block_name',default_where,'the condition')
eg: on scott schema on employee form:
Set_block_Property ('Employee',default_where,'dept_no=30');

in case that u want to remove the condition to retrieve all records you have to reset the Where property as follows:
[code]
Set_block_Property ('Employee',default_where,'');


I hope that was clear to u
Re: Set_block_property Default Where [message #507042 is a reply to message #507039] Thu, 12 May 2011 05:17 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
You do realise that the OP's main problem was the use of ' in the string?
Which you've completely ignored.

Also can you please refrain from using IM speak like u - use full words.
Previous Topic: horizontal canvas
Next Topic: Next Canvas
Goto Forum:
  


Current Time: Sat Sep 07 15:16:55 CDT 2024