Home » Developer & Programmer » Forms » Where clause in data block
Where clause in data block [message #221551] Tue, 27 February 2007 07:33 Go to next message
nick048
Messages: 36
Registered: February 2006
Member
Hi,
I am a newbie on Oracle and I need help on this problem:
In a form data block I want to enter in the Property WHERE CLAUSE a clause based on certain conditions:
1. the first condition is ANA_TYPE := TXT_ANA_TYPE AND ANA_CODE := TXT_ANA_CODE, where the two variable are initialized in Header Block. For this I don't have problem. The query work fine.
2. But I want to add an other clause, depending from an other variable initialized in the Header Block . For example, based on the Radio button field :HEADER_BLOCK.SITUATION. Depending from Value of this field, the AND clause to add can be:
a) :SITUATION = 1 --> clause must be AND DOC_PAID <> 0
b) :SITUATION = 2 --> clause must be AND DOC_PAID = 0
c) :SITUATION = 3 --> clause must be AND DOC_INS <> 0

Is possible to create a unique Where variable clause (1. plus 2.) with this conditions ? If Yes How?

I hope... Razz
Best Regards
Gaetano
Re: Where clause in data block [message #221562 is a reply to message #221551] Tue, 27 February 2007 08:09 Go to previous message
scorpio_biker
Messages: 154
Registered: November 2005
Location: Kent, England
Senior Member
Hi,

You can use the SET_BLOCK_PROPERTY built in using the DEFAULT_WHERE parameter.

The syntax I use is :-
set_block_property('MY_BLOCK',DEFAULT_WHERE,v_where);

where v_where is a varchar2 variable that I build into my where clause depending on the conditions.

Hope this is what you need?
Previous Topic: How to use a button with a required field
Next Topic: TITLE BAR CHANGE
Goto Forum:
  


Current Time: Mon Mar 10 01:47:35 CDT 2025