Application Express includes a number of built-in substitution strings. These provide information that can be used in HTML regions or blocks of PLSQL code.
Use substitution strings within a page template or region source to pass information and replace a character string with another value.
Built-in Substitution Strings
Here are the current APEX substitution strings available to you:
- APP_ID
- APP_ALIAS
- APP_DATE_TIME_FORMAT
- APP_IMAGES
- APP_NLS_DATE_FORMAT
- APP_NLS_TIMESTAMP_FORMAT
- APP_NLS_TIMESTAMP_TZ_FORMAT
- APP_IMAGES
- APP_PAGE_ID
- APP_SESSION
- APP_SESSION_VISIBLE
- APP_UNIQUE_PAGE_ID
- APP_USER
- AUTHENTICATED_URL_PREFIX
- BROWSER_LANGUAGE
- CURRENT_PARENT_TAB_TEXT
- DEBUG
- HOME_LINK
- IMAGE_PREFIX
- LOGIN_URL
- LOGOUT_URL
- PRINTER_FRIENDLY
- PROXY_SERVER
- PUBLIC_URL_PREFIX
- REQUEST
- SCHEMA OWNER
- SQLERRM
- SYSDATE_YYYYMMDD
- WORKSPACE_IMAGES
- APEX$ROW_NUM
- APEX$ROW_SELECTOR
- APEX$ROW_STATUS
Displaying All Values on A Test Page
If you wish to display all of these values in an HTML region for testing purposes then you can use this block of HTML :
<table> <tr><td>APP_ID</td><td>&APP_ID.</td></tr> <tr><td>APP_ALIAS</td><td>&APP_ALIAS.</td></tr> <tr><td>APP_DATE_TIME_FORMAT</td><td>&APP_DATE_TIME_FORMAT.</td></tr> <tr><td>APP_IMAGES</td><td>&APP_IMAGES.</td></tr> <tr><td>APP_NLS_DATE_FORMAT</td><td>&APP_NLS_DATE_FORMAT.</td></tr> <tr><td>APP_NLS_TIMESTAMP_FORMAT</td><td>&APP_NLS_TIMESTAMP_FORMAT.</td></tr> <tr><td>APP_NLS_TIMESTAMP_TZ_FORMAT</td><td>&APP_NLS_TIMESTAMP_TZ_FORMAT.</td></tr> <tr><td>APP_IMAGES</td><td>&APP_IMAGES.</td></tr> <tr><td>APP_PAGE_ID</td><td>&APP_PAGE_ID.</td></tr> <tr><td>APP_SESSION</td><td>&APP_SESSION.</td></tr> <tr><td>APP_SESSION_VISIBLE</td><td>&APP_SESSION_VISIBLE.</td></tr> <tr><td>APP_UNIQUE_PAGE_ID</td><td>&APP_UNIQUE_PAGE_ID.</td></tr> <tr><td>APP_USER</td><td>&APP_USER.</td></tr> <tr><td>AUTHENTICATED_URL_PREFIX</td><td>&AUTHENTICATED_URL_PREFIX.</td></tr> <tr><td>BROWSER_LANGUAGE</td><td>&BROWSER_LANGUAGE.</td></tr> <tr><td>CURRENT_PARENT_TAB_TEXT</td><td>&CURRENT_PARENT_TAB_TEXT.</td></tr> <tr><td>DEBUG</td><td>&DEBUG.</td></tr> <tr><td>HOME_LINK</td><td>&HOME_LINK.</td></tr> <tr><td>IMAGE_PREFIX</td><td>&IMAGE_PREFIX.</td></tr> <tr><td>LOGIN_URL</td><td>&LOGIN_URL.</td></tr> <tr><td>LOGOUT_URL</td><td>&LOGOUT_URL.</td></tr> <tr><td>PRINTER_FRIENDLY</td><td>&PRINTER_FRIENDLY.</td></tr> <tr><td>PROXY_SERVER</td><td>&PROXY_SERVER.</td></tr> <tr><td>PUBLIC_URL_PREFIX</td><td>&PUBLIC_URL_PREFIX.</td></tr> <tr><td>REQUEST</td><td>&REQUEST.</td></tr> <tr><td>SCHEMA OWNER</td><td>&SCHEMA OWNER.</td></tr> <tr><td>SQLERRM</td><td>&SQLERRM.</td></tr> <tr><td>SYSDATE_YYYYMMDD</td><td>&SYSDATE_YYYYMMDD.</td></tr> <tr><td>WORKSPACE_IMAGES</td><td>&WORKSPACE_IMAGES.</td></tr> </table>
Add a “Static Content” region to your page and paste in the HTML as the “Source Text”.
Using Substitution Strings in Regions and Application Items
You can use substitution strings within an HTML block by prefixing with an ampersand and adding a trailing full-stop (period) :
&APP_USER.
Example :
Hello you are logged in as &APP_USER.
Using Substitution Strings in PLSQL page processes
You can use substitution strings within PLSQL blocks using the “v” notation :
v('APP_USER')
Example :
htp.p('Hello you are logged in as'||V('APP_USER'));
Using Substitution Strings in SQL Commands
You can use substitution strings within a SQL query by prefixing the string with a colon :
:APP_USER
Example :
SELECT * FROM some_table WHERE user_id = :APP_USER
For additional information see the official Oracle APEX documentation.