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
Messages: 36
Registered: February 2006
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
Re: Where clause in data block [message #221562 is a reply to message #221551] Tue, 27 February 2007 08:09 Go to previous message
Messages: 154
Registered: November 2005
Location: Kent, England
Senior Member

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

The syntax I use is :-

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
Goto Forum:

Current Time: Fri Aug 18 09:38:40 CDT 2017

Total time taken to generate the page: 0.07144 seconds