Home » Developer & Programmer » Forms » SET_BLOCK_PROPERTY Where Clause SYNTAX
SET_BLOCK_PROPERTY Where Clause SYNTAX [message #249408] Wed, 04 July 2007 06:27 Go to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Guys can someone please tell me what is wrong with the following SYNTAX:

set_block_property('AREA3_MVTS', onetime_where, 'where MVT_ST='||stat_value||' 
and (
MVT_ORIG_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||''':parameter.AREA_PARAM'''||')
OR
MVT_DEST_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||''':parameter.AREA_PARAM'''||')
)'							
);




If I replace the :parameter.AREA_PARAM with a hardcoded value say AR2, then the query is working perfectly. I am debugging my code and displaying the parameter AREA_PARAM value before using it in the Where Clause (it is exactly as the Hardcoded value) but it is not retrieving records???

Please see below Code working fine:

set_block_property('AREA3_MVTS', onetime_where, 'where MVT_ST='||stat_value||' 
and (
MVT_ORIG_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||'''AR2'''||')
OR
MVT_DEST_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||'''AR2'''||')
)'							
);




Any Clue what might be the problem?

Thanks
icon14.gif  Re: SET_BLOCK_PROPERTY Where Clause SYNTAX [message #249419 is a reply to message #249408] Wed, 04 July 2007 07:18 Go to previous message
bbaz
Messages: 138
Registered: April 2007
Senior Member
PROBLEM SOLVED HERE.

SYNTAX CORRECTED AS BELOW:

area_selected := :parameter.AREA_PARAM;

set_block_property('AREA3_MVTS', onetime_where, 'where MVT_ST='||stat_value||' 
and (
MVT_ORIG_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||''''||area_selected||''''||')
OR
MVT_DEST_CD IN (SELECT TANK_CD from TANK where TANK_AREA_CD='||''''||area_selected||''''||')
)'							
);

Previous Topic: How can we call the word document through FORMS
Next Topic: WEB_UTIL installation
Goto Forum:
  


Current Time: Sat Feb 08 23:47:55 CST 2025