Thread: Bug Report: Validations with invalid condition skipped


Permlink Replies: 1 - Pages: 1 - Last Post: Oct 1, 2007 2:28 PM Last Post By: sspadafo
Patrick Wolf

Posts: 1,812
Registered: 04/24/00
Bug Report: Validations with invalid condition skipped
Posted: Oct 1, 2007 11:16 AM
Click to report abuse...   Click to reply to this thread Reply
Hi,

the following thread (http://forums.oracle.com/forums/thread.jspa?threadID=568221&tstart=15 ) remaindered me about a problem a had some time ago, but for which I didn't immediately write posting - shame on me! :-)

But here we go:

1) Create a validation
2) Enter some validation code, eg. 1=2
3) Set as condition type "PL/SQL Expression"
4) Enter syntactical invalid PL/SQL code eg. abcdefg

Run the page and submit the page.

Nothing will happen, the changes will be applied. No error message about the invalid PL/SQL code in the condition!!!

Run the page in debug mode, no information there too!!!

It looks like that in the conditional type handling, all exceptions are mapped to a FALSE result of the condition, instead of raising and showing the error message of the condition execution.

In my opinion that's a little bit dangerous behavior, because you will never be able to find such errors. Also always remember that a package call could have been valid at the time when the validation was developed and tested, but later on the package was dropped and nobody would ever notice that the validation isn't firing anymore...

The change of the exception handler should not only be for syntactically invalid PL/SQL code, but also if a valid code is raising an exception. This should never be mapped to FALSE automatically., because something abnormal happened

BTW, conditions for page items at least show some error text during rendering.

Thanks for looking at it
Patrick
PS: BTW, it would be useful if the Builder would check the syntax of the PL/SQL code immediately. :-)


My APEX Blog: http://inside-apex.blogspot.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/
sspadafo

Posts: 16,581
Registered: 01/10/01
Re: Bug Report: Validations with invalid condition skipped
Posted: Oct 1, 2007 2:28 PM   in response to: Patrick Wolf in response to: Patrick Wolf
Click to report abuse...   Click to reply to this thread Reply
Patrick,

Thanks for the details, we'll have to fix this.

It's a case where the engine does raise an exception and outputs error using htp.p but the redirect branch on the page causes the htp buffer to be cleared. You can actually see the error message if you create and use a branch-to-page branch instead.

Scott
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums