Sunday, September 14, 2025

APEX printer friendly mode - how to enable it ?

If you are wondering why your APEX page is not shown in printer-friendly mode after specifying "Yes" in the relevant parameter of the URL, the reason is simply that "Yes" as reported in the documentation of APEX 24.x is wrong, you must specify "YES" in uppercase.

I believe Oracle should accept a case insensitive value for that parameter and avoid a lot of headaches, I mean, it's just a matter of taking the UPPER value and that's it, end of story.

If, for some reason, you cannot change the URL or you don't want to use the URL to activate printer friendly mode, there is still the option to use a conditional before header process where you set the variable:
APEX_APPLICATION.g_printer_friendly := TRUE;

The condition could be based on a REQUEST value or on some other expression of your choosing.

If, for some reason, you are struggling to understand whether the page is in printer-friendly mode or not, the easy way to know it is by adding temporarily a region with the condition "Current page is in printer-friendly mode" (or the opposite, whichever you prefer).

Thursday, September 04, 2025

Item ID (P9999_USERNAME) is not an item defined on the current page.

If you are hitting this weird problem when trying to login to your APEX app running on Oracle ADB 23ai:

Item ID (P9999_USERNAME) is not an item defined on the current page. 

According to Oracle APEX development team members this seems to be related to an issue with the database result cache mechanism that can be fixed by executing this procedure as SYSDBA (ADMIN user on ADB):

begin dbms_result_cache.flush; end;

You can find the whole story about the problem on this forum thread.

Now, I am not completely clear if this problem was fixed at some point and then popped up again on a more recent version of Oracle 23ai, in my case ADB is version 23.9.0.25.08 and APEX has been recently upgraded to 24.2.8. 

I am glad I quickly found the workaround this morning as it was really driving me crazy.

PS: The same caching bug seems to affect also APEX_EXEC.OPEN_QUERY_CONTEXT, that is if you change the query in parameter p_sql_query, the new query will be ignored and the "cached" will continue to be executed. 

Tuesday, July 22, 2025

stringify() or to_string() ?

While I was experimenting with genAI LLMs applied to generating PL/SQL code, I noticed that Claude-Sonnet created a function containing a stringify() method applied to a JSON_ELEMENT_T variable, a method whose existence I wasn't aware of.
l_string := j_elem.stringify();

This method is documented in the serialization methods paragraph in Oracle23ai JSON Developer's Guide, but it turns out that it works also in Oracle19c (at least on version 19.21.0.0.0) even if the guide doesn't mention it.

As far as I could see it's equivalent to method to_string(), so you can pick whichever you like.

PS:   2025/08/10

Oracle 23ai PL/SQL Packages and Types Reference actually states the following:

"The FUNCTION stringify is synonym of to_String. It has the same functionality."

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles