APEX-AT-WORK no image

Strange behavior of "No Inline Validation Errors Displayed" check

Von Tobias Arnhold 11.19.2009
I had two conditional processing checks for one pl/sql process to do. One "No Inline Validation Errors Displayed" check and one "Exist (SQL query returns at least one row)" check.

I thought it would be quite easy to merge it together into a "Exist (SQL query returns at least one row)" condition:

select *
from user_db_links
where UPPER(db_link) = UPPER(:P1_I_INSTANCE_NAME)
and (UPPER(username) not like UPPER(:P1_USERNAME)
or UPPER(host) not like UPPER(:P1_DB_NAME)
or :P1_PASSWORD is not null)
and wwv_flow.g_inline_validation_error_cnt = 0

-- and I tried this AND clause
-- and (select wwv_flow.g_inline_validation_error_cnt from DUAL) = 0

The result was less promising. It just didn't work. The pl/sql process never run with wwv_flow.g_inline_validation_error_cnt in it.

My workaround was to add a new item called :P1_ERROR. I wrote the amount of validation errors into the :P1_ERROR variable inside a pl/sql process which was running before the one I tried the conditional processing with.

-- pl/sql process 1.
...
SELECT wwv_flow.g_inline_validation_error_cnt INTO :P1_ERROR FROM DUAL;
-- or this: :P1_ERROR := wwv_flow.g_inline_validation_error_cnt;
...

-- pl/sql process 2.
select *
from user_db_links
where UPPER(db_link) = UPPER(:P1_I_INSTANCE_NAME)
and (UPPER(username) not like UPPER(:P1_USERNAME)
or UPPER(host) not like UPPER(:P1_DB_NAME)
or :P1_PASSWORD is not null)
and :P1_ERROR = 0

This works without any issues. Maybe one of you know why this happens?

Post Tags:

2 Comments " Strange behavior of "No Inline Validation Errors Displayed" check "

Patrick Wolf 20 November, 2009 11:21

Hi Tobias,

have you tried to execute your SQL statement in SQL*Plus/SQL Workshop, ...? It will fail as well, because you can't access a package global variable in a SQL statement. You could write a wrapper function which just returns the global variable to access it in your SQL statement.

The PL/SQL process didn't run, because the condition was syntactically invalid which is currently treaded as false (-> which is a bug).

About your workaround:

You don't have to use a SELECT INTO from DUAL to read a global package variable. Just write :P1_ERROR := wwv_flow.g_inline_validation_error_cnt;

Regards
Patrick

Tobias Arnhold 20 November, 2009 12:08

Hi Patrick!
Thanks for the info.
Regards Tobias