Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bracket error

Status
Not open for further replies.

zapata

IS-IT--Management
Jan 20, 2003
16
NL
I believe my logic is right but my bracketing is not.
My boolean requirement is that j can have an 'a' or 'b' or 'x' values as long as c or s or cont is not empty.
same holds true for k. k can have a value of 'a' or 'b' as long as c or s or cont are not empty.
any violation will throw some form trigger error.
I my code, what is happening is that it didn't matter whether c or s or cont are empty, it is throwing out error messages as long as j or k has any of the values described above.
If I have not lost you, here is my code:

BEGIN
IF :)J='A'
OR :J='B'
OR :J='X'
OR :K='A'
OR :K='B')
AND :)C IS NULL
OR :S IS NULL
OR :CONT IS NULL) THEN
MESSAGE(none of these must be entered');
RAISE FORM_TRIGGER_FAILURE;
END IF;
END;
 
zapata,

try this code

BEGIN
IF (:)J='A' OR :J = 'B' OR :J = 'X' OR :K = 'A' OR :K = 'B') and :)c is not null or :s is not null or :cont is not null))

THEN
NULL;
ELSE
MESSAGE(none of these must be entered');
RAISE FORM_TRIGGER_FAILURE;
END IF;

Thanks
Pani
 
thanks pani2304. It is still not working.
When I ran your modication, it is not even allowing me to test for :
IF (:)J='A' OR :J = 'B' OR :J = 'X' OR :K = 'A' OR :K = 'B'). It just assumed the rest was null and crashed.
I modified it slightly but it works if any of these
:J='A' OR :J = 'B' OR :J = 'X' OR :K = 'A' evaluates to true.
What I would like to see happen is that if any of the above is true but c is not null or s is not null or cont is null and it won't raise any form trigger failure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top