3.10.4 Using Built-in Substitution Strings
Learn about built-in substitution strings available in App Builder.
App Builder supports many built-in substitution strings. You can reference these substitution strings to achieve specific types of functionality.
Tip:
Note that bind variable :USER
has special meaning within the database. Also, the term Direct PL/SQL refers to PL/SQL that can be used in stored database objects such as procedures and functions.
- APEX_CSP_DISPLAY_NONE
- APEX_FILES
- APEX$ROW_NUM
- APEX$ROW_SELECTOR
- APEX$ROW_STATUS
- APP_ID
- APP_ALIAS
- APP_AJAX_X01, ... APP_AJAX_X10
- APP_BUILDER_SESSION
- APP_DATE_TIME_FORMAT
- APP_FILES
- APP_NLS_DATE_FORMAT
- APP_NLS_TIMESTAMP_FORMAT
- APP_NLS_TIMESTAMP_TZ_FORMAT
- APP_PAGE_ALIAS
- APP_PAGE_ID
- APP_REGION_ID
- APP_REGION_STATIC_ID
- APP_REQUEST_DATA_HASH
- APP_SESSION
- APP_SESSION_VISIBLE
- APP_TITLE
- APP_UNIQUE_PAGE_ID
- APP_USER
- APP_VERSION
- AUTHENTICATED_URL_PREFIX
- BROWSER_LANGUAGE
- CURRENT_PARENT_TAB_TEXT
- DEBUG
- HOME_LINK
- JET_BASE_DIRECTORY
- JET_CSS_DIRECTORY
- JET_JS_DIRECTORY
- LOGIN_URL
- LOGOUT_URL
- APP_TEXT$Message_Name, APP_TEXT$Message_Name$Lang
- OWNER
- PRINTER_FRIENDLY
- PROXY_SERVER
- PUBLIC_URL_PREFIX
- REQUEST
- Using REQUEST
- SCHEMA OWNER
- SQLERRM
- SYSDATE_YYYYMMDD
- THEME_DB_FILES
- THEME_FILES
- WORKSPACE_FILES
- WORKSPACE_ID
Parent topic: Using Substitution Strings
3.10.4.1 APEX_CSP_DISPLAY_NONE
Content Security Policy (CSP) guidelines prohibit the use of or direct
inline CSS. The APEX_CSP_DISPLAY_NONE
substitution string ensures
that Oracle APEX only renders safe CSS inline exceptions using a centralized substitution
string.
Use the APEX_CSP_DISPLAY_NONE
substitution string to render the
following inline CSS:
style=display:none;
Supported syntax for referencing APEX_CSP_DISPLAY_NONE
:
#APEX_CSP_DISPLAY_NONE#
APEX_CSP_DISPLAY_NONE Example
The following example demonstrates the use of
APEX_CSP_DISPLAY_NONE
in the Universal Theme region template,
Inline Dialog.
<div id="#REGION_STATIC_ID#_parent">
<div id="#REGION_STATIC_ID#" class="t-DialogRegion #REGION_CSS_CLASSES# js-regionDialog" #REGION_LANDMARK_ATTRIBUTES# #REGION_ATTRIBUTES# #APEX_CSP_DISPLAY_NONE# title="#TITLE!ATTR#">
<div class="t-DialogRegion-wrap">
<div class="t-DialogRegion-bodyWrapperOut"><div class="t-DialogRegion-bodyWrapperIn"><div class="t-DialogRegion-body">#BODY##SUB_REGIONS#</div></div></div>
<div class="t-DialogRegion-buttons">
<div class="t-ButtonRegion t-ButtonRegion--dialogRegion">
<div class="t-ButtonRegion-wrap">
<div class="t-ButtonRegion-col t-ButtonRegion-col--left"><div class="t-ButtonRegion-buttons">#PREVIOUS##DELETE##CLOSE#</div></div>
<div class="t-ButtonRegion-col t-ButtonRegion-col--right"><div class="t-ButtonRegion-buttons">#EDIT##CREATE##NEXT#</div></div>
</div>
</div>
</div>
</div>
</div>
</div>
Parent topic: Using Built-in Substitution Strings
3.10.4.2 APEX_FILES
Note:
IMAGE_PREFIX
has been renamed to APEX_FILES
.
Although the legacy name, IMAGE_PREFIX
, is still supported, Oracle
recommends using the new name.
The value of APEX_FILES
determines the virtual path the web server uses to point to the images directory distributed with Oracle APEX. To reference uploaded images, use WORKSPACE_FILES
and APP_FILES
.
Reference Type | Syntax |
---|---|
Bind variable | :APEX_FILES |
Direct PL/SQL |
Note: Direct PL/SQL is an exception. Use
|
PL/SQL | V('APEX_FILES') |
Substitution string | &APEX_FILES. |
Template Substitution | #APEX_FILES# |
Parent topic: Using Built-in Substitution Strings
3.10.4.3 APEX$ROW_NUM
APEX$ROW_NUM
refers the currently processed row number of a
submitted tabular form data. You can use this placeholder in validations, processes,
and conditions associated with a tabular form to refer to the row number of the
currently processed tabular form row.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.4 APEX$ROW_SELECTOR
Use APEX$ROW_SELECTOR
in validations, processes, and conditions
associated with a tabular form to refer to the row
selector checkbox in a tabular form. This
placeholder returns X
if the
tabular form row selector checkbox of the
currently processed tabular form row is checked
and NULL
if it unchecked.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.5 APEX$ROW_STATUS
Use APEX$STATUS
in validations, processes, and conditions associated
with a tabular form to refer to the row status in a tabular form. This placeholder
returns the status of C
if created, U
if updated,
or D
if deleted for the currently processed tabular form row.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.6 APP_ID
APP_ID
identifies the application ID of the currently executing
application.
Reference Type | Syntax |
---|---|
Bind variable | :APP_ID |
Direct PL/SQL | APEX_APPLICATION.G_FLOW_ID (A NUMBER) |
PL/SQL | NV('APP_ID') |
Substitution string | &APP_ID. |
SYS_CONTEXT variable | SYS_CONTEXT('APEX$SESSION', 'APP_ID') |
Substitution String Reference Example
The following is an example of a substitution string reference:
f?p=&APP_ID.:40:&APP_SESSION.
SYS_CONTEXT Variable Example
The following is a SYS_CONTEXT
variable example:
SELECT ... WHERE application_id = SYS_CONTEXT('APEX$SESSION', 'APP_ID')
APEX sets up the APEX$SESSION
context when it starts to process an incoming request. For example, you can use the value of 'APP_ID'
to access the current application ID in queries and Virtual Private Database (VPD) security policies that protect your table data.
Parent topic: Using Built-in Substitution Strings
3.10.4.7 APP_ALIAS
APP_ALIAS
is an alphanumeric name for the current application. APP_ALIAS
is different from the APP_ID
in that the APP_ID
must be unique over all workspaces and all applications hosted in one database. In contrast, APP_ALIAS
must be unique within a workspace. For example, by using the same APP_ALIAS
you can create the application, ABC, in two different workspaces. You can use APP_ALIAS
almost anywhere APP_ID
can be used. For example, f?p
syntax can use an APP_ALIAS
or an application ID as demonstrated in this example:
f?p=ABC:1:&APP_SESSION.
This example runs application ABC, page 1 using the current session.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
The following is an HTML example:
Click me to go to page 1 <a href="f?p=&APP_ALIAS.:1:&APP_SESSION."> of the current application</a>
Parent topic: Using Built-in Substitution Strings
3.10.4.8 APP_AJAX_X01, ... APP_AJAX_X10
APP_AJAX_Xnn
specifies the values of the APP_AJAX_X01, ... APP_AJAX_X10
URL parameters most recently passed to or set within the show or accept modules. You typically use these variables in On Demand AJAX processes.
Reference Type | Syntax |
---|---|
Bind variable | ... :APP_AJAX_X01, ... :APP_AJAX_X10 |
PL/SQL | ... v('APP_AJAX_X01'), ... v('APP_AJAX_X10') |
Substitution string | ... &APP_AJAX_X01., ... &APP_AJAX_X10. |
Parent topic: Using Built-in Substitution Strings
3.10.4.9 APP_BUILDER_SESSION
If the user is also logged in to the workspace as a developer, APP_BUILDER_SESSION
contains the current session ID of the development environment. Otherwise, APP_BUILDER_SESSION
is null.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.10 APP_DATE_TIME_FORMAT
APP_DATE_TIME_FORMAT
is the application date time format of the
application. This value reflects the format specified in the Application Date Time
Format attribute of the Globalization settings of an application. If the Application
Date Time Format is not set in an application, then a reference to
APP_DATE_TIME_FORMAT
returns the database session NLS date
format and the NLS time format.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.11 APP_FILES
Note:
APP_IMAGES
has been renamed to APP_FILES
. Although the
legacy name, APP_IMAGES
, is still supported, Oracle recommends using the
new name.
Use this substitution string to reference uploaded images, JavaScript, and cascading style sheets that are specific to a given application and are not shared over many applications. If you upload a file and make it specific to an application, then you must use this substitution string, or bind variable.
Reference Type | Syntax |
---|---|
Bind variable | :APP_FILES |
Direct PL/SQL | Not available. |
PL/SQL | V('APP_FILES') |
Substitution string | &APP_FILES. |
Template substitution | #APP_FILES# |
See Also:
Parent topic: Using Built-in Substitution Strings
3.10.4.12 APP_NLS_DATE_FORMAT
APP_NLS_DATE_FORMAT
is the application date format of the database session. This value reflects the format specified in the Application Date Format attribute of the Globalization settings of the application. However, if the Application Date Format is not set, then APP_NLS_DATE_FORMAT
returns the NLS_DATE_FORMAT
value of the database session at the start of the request to the APEX engine.
Reference Type | Syntax |
---|---|
Bind variable | :APP_NLS_DATE_FORMAT |
PL/SQL | V('APP_NLS_DATE_FORMAT') |
Substitution string | &APP_NLS_DATE_FORMAT. |
Parent topic: Using Built-in Substitution Strings
3.10.4.13 APP_NLS_TIMESTAMP_FORMAT
APP_NLS_TIMESTAMP_FORMAT
is the application timestamp format of the database session. This value reflects the format specified in the Application Timestamp Format attribute of the Globalization settings of the application. However, if the Application Timestamp Format is not set, then APP_NLS_TIMESTAMP_FORMAT
return the NLS_TIMESTAMP_FORMAT
value of the database session at the start of the request to the APEX engine.
Table 3-2 APP_NLS_TIMESTAMP_FORMAT Syntax
Reference Type | Syntax |
---|---|
Bind variable | :APP_NLS_TIMESTAMP_FORMAT |
PL/SQL | V('APP_NLS_TIMESTAMP_FORMAT') |
Substitution string | &APP_NLS_TIMESTAMP_FORMAT. |
Parent topic: Using Built-in Substitution Strings
3.10.4.14 APP_NLS_TIMESTAMP_TZ_FORMAT
APP_NLS_TIMESTAMP_TZ_FORMAT
is the application timestamp time zone format of the database session. This value reflects the format specified in the Application Timestamp Time Zone Format attribute of the Globalization settings of an application. However, if the Application Timestamp Time Zone Format is not set, then APP_NLS_TIMESTAMP_TZ_FORMAT
returns the NLS_TIMESTAMP_TZ_FORMAT
value of the database session at the start of the request to the APEX engine.
Reference Type | Syntax |
---|---|
Bind variable | :APP_NLS_TIMESTAMP_TZ_FORMAT |
PL/SQL | V('APP_NLS_TIMESTAMP_TZ_FORMAT') |
Substitution string | &APP_NLS_TIMESTAMP_TZ_FORMAT. |
Parent topic: Using Built-in Substitution Strings
3.10.4.15 APP_PAGE_ALIAS
APP_PAGE_ALIAS
is an alphanumeric name for the current application
page. A page alias is not case-sensitive and it is an optional page attribute.
APP_PAGE_ALIAS
is unique within an application. You can use
APP_PAGE_ALIAS
almost anywhere APP_PAGE_ID
can
be used.
Reference Type | Syntax |
---|---|
Bind variable |
:APP_PAGE_ALIAS |
PL/SQL |
v('APP_PAGE_ALIAS') |
Substitution string |
&APP_PAGE_ALIAS. |
The following is an HTML example:
The alias of the current page is: &APP_PAGE_ALIAS
.
Parent topic: Using Built-in Substitution Strings
3.10.4.16 APP_PAGE_ID
APP_PAGE_ID
is the current application page ID. For example, if
your application was on page 3, then the result would be 3. Using this syntax is
useful when writing application components that must work generically in multiple
applications.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
PL/SQL and Direct PL |
|
Substitution string |
|
The following is an example of a substitution string reference:
f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.
Parent topic: Using Built-in Substitution Strings
3.10.4.17 APP_REGION_ID
APP_REGION_ID
identifies the ID of the current
executing region.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.18 APP_REGION_STATIC_ID
APP_REGION_STATIC_ID
identifies the static ID of the current
executing region. If no static ID has been entered by a developer, NULL is
returned.
Table 3-3 APP_REGION_STATIC_ID Syntax
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.19 APP_REQUEST_DATA_HASH
APP_REQUEST_DATA_HASH
is a hash value of the request, item name, and item value parts in the URL. It is primarily useful to detect whether two browser requests passed different parameters to APEX.
Table 3-4 APP_REQUEST_DATA_HASH Syntax
Reference Type | Syntax |
---|---|
Bind variable | :APP_REQUEST_DATA_HASH |
PL/SQL | V('APP_REQUEST_DATA_HASH') |
Substitution string | &APP_REQUEST_DATA_HASH. |
Parent topic: Using Built-in Substitution Strings
3.10.4.20 APP_SESSION
APP_SESSION
is the most commonly used built-in substitution
strings. You can use this substitution string to create hypertext links between
application pages that maintain a session state by passing the session number. Note
that you can also use the substitution string SESSION
in place of
APP_SESSION
.
Table 3-5 APP_SESSION Syntax
Reference Type | Syntax |
---|---|
Bind variable | :APP_SESSION
|
PL/SQL | V('APP_SESSION') |
Short PL/SQL | V('SESSION')
|
Substitution string | &APP_SESSION. |
SYS_CONTEXT variable | SYS_CONTEXT('APEX$SESSION', 'APP_SESSION') |
Consider the following examples:
- From within an HTML region:
<a href="f?p=100:5:&APP_SESSION.">click me</a>
- Using PL/SQL:
htf.anchor('f?p=100:5:'||V('APP_SESSION'),'click me');
- Using a SQL query:
SELECT htf.anchor('f?p=100:5:'||:APP_SESSION,'click me') FROM DUAL;
-
Using the
SYS_CONTEXT
variable:SELECT ... WHERE apex_session_id = SYS_CONTEXT('APEX$SESSION', 'APP_SESSION')
APEX sets up the
APEX$SESSION
context when it starts to process an incoming request. For example, you can use the value of'APP_SESSION'
to access the current application session in queries and VPD (Virtual Private Database) security policies that protect your table data.
Parent topic: Using Built-in Substitution Strings
3.10.4.21 APP_SESSION_VISIBLE
APP_SESSION_VISIBLE
is similar to the built-in substitution APP_SESSION
. Use this substitution string to create hypertext links between application pages that maintain a session state by passing the session number. APP_SESSION_VISIBLE
always returns '0' when users are not authenticated to an application and they are using the Zero Session ID feature of APEX.
Reference Type | Syntax |
---|---|
Bind variable | :APP_SESSION_VISIBLE |
PL/SQL | V('APP_SESSION_VISIBLE') |
Substitution string | &APP_SESSION_VISIBLE. |
Consider the following examples:
- From within an HTML region:
<a href="f?p=100:5:&APP_SESSION_VISIBLE.">click me</a>
- Using PL/SQL:
sys.htf.anchor('f?p=100:5:'||V('APP_SESSION_VISIBLE'),'click me');
- Using a SQL query:
SELECT sys.htf.anchor('f?p=100:5:'||:APP_SESSION_VISIBLE,'clickme') FROM DUAL;
Parent topic: Using Built-in Substitution Strings
3.10.4.22 APP_TITLE
APP_TITLE
is an alphanumeric title for the current application. The
title is derived from an application substitution string called
APP_TITLE
. If not defined the Logo attribute will be used if it
is of type text. The last fallback is the application name.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
The following is an HTML example:
The title of the current application is: &APP_TITLE!HTML.
Parent topic: Using Built-in Substitution Strings
3.10.4.23 APP_UNIQUE_PAGE_ID
APP_UNIQUE_PAGE_ID
is an integer generated from an Oracle sequence
which is unique for each page view. This number is used by applications to prevent
duplicate page submissions and can be used for other purposes. For example, to make
a unique URL and avoid browser caching issues, you can embed this number in the
request or debug column in calls to the f
procedure.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
The following is an HTML example:
SELECT 'f?p=100:1:'||:APP_SESSION||':'||:APP_UNIQUE_PAGE_ID|| ':::P1_EMPNO:'||employee_id, first_name, job_id FROM employees
Note the use of the APP_UNIQUE_PAGE_ID
in the request column. This makes this URL unique and may avoid excessive browser caching problems.
Parent topic: Using Built-in Substitution Strings
3.10.4.24 APP_USER
APP_USER
is the current user running the application. Depending
upon your authentication model, the value of the user is set differently. If the
application is running using database authentication, then the value of the user is
the same as the database pseudo column USER. If the application uses an
authentication scheme that requires the user to authenticate, the value of
APP_USER
is set by the authentication scheme, usually to the
user name used during authentication.
Reference Type | Syntax |
---|---|
Bind variable | :APP_USER |
PL/SQL | V('APP_USER') |
Substitution string | &APP_USER. |
SYS_CONTEXT variable
|
SYS_CONTEXT('APEX$SESSION', 'APP_USER') |
Consider the following examples:
- From within an HTML region:
Hello you are logged in as &APP_USER.
- Using PL/SQL:
htp.p('Hello you are logged in as'||V('APP_USER'));
- As a bind variable:
SELECT * FROM some_table WHERE user_id = :APP_USER
- Using the
SYS_CONTEXT
variable:SELECT ... WHERE username = SYS_CONTEXT('APEX$SESSION', 'APP_USER')
APEX sets up the
APEX$SESSION
context when it starts to process an incoming request. For example, you can use the value of'APP_USER'
to access the current application user in queries and VPD (Virtual Private Database) security policies that protect your table data.See Also:
Authentication for information about the Public User attribute
Parent topic: Using Built-in Substitution Strings
3.10.4.25 APP_VERSION
Use APP_VERSION
to get the entered version of your application. You
can use APP_VERSION
to display it in your application or append it
to external static files to automatically invalidate the browser cache when the
application gets updated.
Reference Type | Syntax |
---|---|
Substitution string | #APP_VERSION# |
Parent topic: Using Built-in Substitution Strings
3.10.4.26 AUTHENTICATED_URL_PREFIX
This application-level attribute identifies a valid authenticated prefix (that is, a
logged in URL prefix). You can use a relative path or a full path beginning with
http
. This item is useful if your application can be run in
both authenticated (logged in) and public (not logged in) modes. You can use
AUTHENTICATED_URL_PREFIX
to construct a link to an
authenticated page. This item is most useful when using basic database
authentication because changes to the URL can require authentication.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.27 BROWSER_LANGUAGE
BROWSER_LANGUAGE
refers to the web browser's current language
preference.
Reference Type | Syntax |
---|---|
Bind variable |
|
Direct PL/SQL |
|
PL/SQL |
|
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.28 CURRENT_PARENT_TAB_TEXT
CURRENT_PARENT_TAB_TEXT
is most useful in page templates, but is
only relevant for applications that use two-level tabs (that is, parent and standard
tabs). Use this string to reference the parent tab label. This substitution string
enables you to repeat the currently selected parent tab within the page
template.
Reference Type | Syntax |
---|---|
Bind variable |
Not Available. |
Substitution string |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.29 DEBUG
Valid values for the DEBUG
flag are Yes
or
No
. Turning debug on shows
details about application processing. If you write
your own custom code, you may want to generate
debug information only if the debug mode is set to
Yes
.
Reference Type | Syntax |
---|---|
Bind variable |
: |
Direct PL/SQL |
|
PL/SQL |
|
Substitution string |
|
The following is an example of a substitution string reference that preserves the current value of DEBUG
:
f?p=100:1:&APP_SESSION.::&DEBUG
Parent topic: Using Built-in Substitution Strings
3.10.4.30 HOME_LINK
HOME_LINK
is the home page of an application. The APEX engine redirects to this location if no page is given and if no alternative page is dictated by the authentication scheme's logic. You define the Home URL on the User Interface page, under Attributes.
Reference Type | Syntax |
---|---|
Direct PL/SQL | APEX_APPLICATION.G_HOME_LINK |
PL/SQL | V('HOME_LINK') |
Template Reference | #HOME_LINK# |
Substitution String | &HOME_LINK. |
See Also:
Parent topic: Using Built-in Substitution Strings
3.10.4.31 JET_BASE_DIRECTORY
Use the JET_BASE_DIRECTORY
substitution string to reference the base directory of the Oracle JavaScript Extension Toolkit (JET) which ships with APEX. Supported syntax for referencing JET_BASE_DIRECTORY
:
#JET_BASE_DIRECTORY#
Parent topic: Using Built-in Substitution Strings
3.10.4.32 JET_CSS_DIRECTORY
Use the JET_CSS_DIRECTORY
substitution string to reference the base directory of the Oracle JavaScript Extension Toolkit (JET) which ships with APEX. Supported syntax for referencing JET_CSS_DIRECTORY
:
#JET_CSS_DIRECTORY#
Parent topic: Using Built-in Substitution Strings
3.10.4.33 JET_JS_DIRECTORY
Use the JET_JS_DIRECTORY
substitution string to reference the JavaScript directory of the Oracle JavaScript Extension Toolkit (JET) components which ships with APEX. Supported syntax for referencing JET_JS_DIRECTORY
:
#JET_JS_DIRECTORY#
Parent topic: Using Built-in Substitution Strings
3.10.4.34 LOGIN_URL
Use LOGIN_URL
to display a link to a login page for users that are
not currently logged in.
See Also:
Reference Type | Syntax |
---|---|
Bind variable | :LOGIN_URL |
Direct PL/SQL | APEX_APPLICATION.G_LOGIN_URL |
PL/SQL | V('LOGIN_URL') |
Substitution string | &LOGIN_URL. |
Template Substitution | #LOGIN_URL# |
Parent topic: Using Built-in Substitution Strings
3.10.4.35 LOGOUT_URL
LOGOUT_URL
is an application-level attribute used to identify the
logout URL. This is a URL that navigates the user to a logout page or optionally
directly logs out a user. To create a logout navigation bar entry, add a trailing
period to &LOGOUT_URL
(&LOGOUT_URL.
). If
you are coding a page template, use #LOGOUT_URL#
.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Template substitution |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.36 APP_TEXT$Message_Name, APP_TEXT$Message_Name$Lang
With APP_TEXT$Message_Name, APP_TEXT$Message_Name$Lang
built-in substitution, you can access application defined or system defined text messages, like APEX_LANG.MESSAGE
. Message_Name
is the name of the text message, Message_Name
has to be a valid identifier (A-Z, 0-9, $, #, _
). The optional $Lang
parameter can be used to access a specific translation, $Lang
defaults to the current language for the page request.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
The following is an example for the default and the French text message MY_MESSAGE
, using HTML escaping:
Default text: &APP_TEXT$MY_MESSAGE!HTML.
Pardon my French: &APP_TEXT$MY_MESSAGE$FR!HTML.
Parent topic: Using Built-in Substitution Strings
3.10.4.37 OWNER
The #OWNER#
substitution returns the parsing schema of the APEX application. Use #OWNER#
to reference this value in SQL queries,
PL/SQL or within substitutions.
Parent topic: Using Built-in Substitution Strings
3.10.4.38 PRINTER_FRIENDLY
The value of PRINTER_FRIENDLY
determines if the APEX engine is running in print view mode. This setting can be referenced in conditions to eliminate elements not desired in a printed document from a page.
Reference Type | Syntax |
---|---|
Direct PL/SQL | APEX_APPLICATION.G_PRINTER_FRIENDLY (VARCHAR2 DATATYPE) |
PL/SQL | V('PRINTER_FRIENDLY') |
Substitution string | &PRINTER_FRIENDLY. |
Parent topic: Using Built-in Substitution Strings
3.10.4.39 PROXY_SERVER
PROXY_SERVER
is an application attribute. The attribute may be used by regions whose source comes from a URL. The following is the correct syntax for a direct PL/SQL reference used when you are writing PL/SQL to access remote web servers from within the database (for example, when using the utl_http
package shipped with the database).
APEX_APPLICATION.G_PROXY_SERVER
Parent topic: Using Built-in Substitution Strings
3.10.4.40 PUBLIC_URL_PREFIX
PUBLIC_URL_PREFIX
is an application-level attribute that identifies
a URL to toggle out of a logged in mode to a public view.
Reference Type | Syntax |
---|---|
Bind variable |
|
PL/SQL |
|
Substitution string |
|
Template substitution |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.41 REQUEST
Each application button sets the value of REQUEST
to the name of the button or to the request value attribute associated with the button, enabling accept processing to reference the name of the button when a user clicks it. In the f?p
syntax, REQUEST
may be set using the fourth argument.
REQUEST
is typically referenced during Accept processing (that is,
the processing that occurs when you post a page).
Reference Type | Syntax |
---|---|
Bind variable |
|
Direct PL/SQL |
|
PL/SQL |
|
Substitution string |
|
See Also:
Parent topic: Using Built-in Substitution Strings
3.10.4.42 Using REQUEST
REQUEST
is typically referenced during Accept processing (that is, the processing that occurs when you post a page). This section describes additional information about how to use the REQUEST substitution string.
- About Scope and Value of REQUEST for Posted Pages
- About the When Button Pressed Attribute
- About Referencing REQUEST Using Declarative Conditions
- About Using REQUEST for Show Processing
- About Using BRANCH_TO_PAGE_ACCEPT
See Also:
Parent topic: Using Built-in Substitution Strings
3.10.4.42.1 About Scope and Value of REQUEST for Posted Pages
When you post a page, you initiate Accept processing. Accept processing consists of computations, validations, processes, and branches. The value of REQUEST
is available during each phase of the Accept processing. Once an application branches to a different page then REQUEST
is set to NULL.
The value of REQUEST
is the name of the button the user clicks, or the name of the tab the user selects. For example, suppose you have a button with a name of CHANGE
, and a label Apply Change
. When a user clicks the button, the value of REQUEST
is CHANGE
.
Parent topic: Using REQUEST
3.10.4.42.2 About the When Button Pressed Attribute
Validations, processes, and branches have a When Button Pressed attribute. This attribute displays as a select list and contains the names of buttons that exist on the current page. If you make a selection from When Button Pressed, you associate the button's REQUEST
value with the validation, process, or branch.
When you use a button to submit a page, the REQUEST
value is passed to the page. The Accept processing logic evaluates each validation, process, and branch that uses a When Button Pressed attribute to determine whether the component should run (or fire). When one of these components runs, do not assume that a user actually clicked the associated button and caused the page to be submitted. Keep in mind, that another button using the same request value may have submitted the page. Similarly, JavaScript on the page can also submit the page and pass in a request value.
Parent topic: Using REQUEST
3.10.4.42.3 About Referencing REQUEST Using Declarative Conditions
Many developers reference REQUEST
using conditions. For example, you may want to reset pagination when a user clicks Go on a report page. You can reset pagination by creating an on-submit page process. The page process can be made conditional using the condition Request = Expression 1
.
To conditionalize an on-submit page process:
-
Under Condition, select the condition type Request = Expression 1.
-
In Expression 1, enter GO.
Parent topic: Using REQUEST
3.10.4.42.4 About Using REQUEST for Show Processing
You can also use REQUEST
for Show processing when navigating to a page using f?p
syntax. For example:
f?p=100:1:&APP_SESSION.:GO
Remember that the fourth argument in the f?p
syntax is REQUEST
. This example goes to application 100, page 1 for the current session, and sets the value of REQUEST
to GO
. Any process or region can reference the value of REQUEST
using Show processing.
The following is a similar example using PL/SQL:
IF V ('REQUEST') = 'GO' THEN htp.p('hello'); END IF;
Note that htp.p('hello')
is a call to a PL/SQL Web Toolkit package to print the specified text string.
See Also:
Parent topic: Using REQUEST
3.10.4.42.5 About Using BRANCH_TO_PAGE_ACCEPT
You can use a special request BRANCH_TO_PAGE_ACCEPT
for Show processing to automatically submit the page. For example:
f?p=100:1:&APP_SESSION.:BRANCH_TO_PAGE_ACCEPT|SAVE:::P1_DATA:value
Using BRANCH_TO_PAGE_ACCEPT
is the same as navigating to page 1, entering a value into the item P1_DATA, and clicking a button that submits the page with a SAVE request.
Parent topic: Using REQUEST
3.10.4.43 SCHEMA OWNER
If you are generating calls to applications from within your PL/SQL code, you must reference the owner of the APEX schema. The following describes the correct syntax for a direct PL/SQL reference:
APEX_APPLICATION.G_FLOW_SCHEMA_OWNER
You may also use #FLOW_OWNER#
to reference this value in SQL queries and PL/SQL (for example, in a region or a process).
Parent topic: Using Built-in Substitution Strings
3.10.4.44 SQLERRM
SQLERRM
is a template substitution only available in the Applications Region Error Message. Supported syntax for a region template substitution reference:
#SQLERRM#
Parent topic: Using Built-in Substitution Strings
3.10.4.45 SYSDATE_YYYYMMDD
SYSDATE_YYYYMMDD
represents the current date on the database server, with the YYYYMMDD
format mask applied. You may use this value instead of repeated calls to the SYSDATE()
function. The following list describes the supported syntax for referencing SYSDATE_YYYYMMDD
.
-
Bind variable
:SYSDATE_YYYYMMDD
-
PL/SQL
V('SYSDATE_YYYYMMDD')
-
Direct PL/SQL
APEX_APPLICATION.G_SYSDATE (DATE DATATYPE)
Reference Type | Syntax |
---|---|
Bind variable |
|
Direct PL/SQL |
|
PL/SQL |
|
Parent topic: Using Built-in Substitution Strings
3.10.4.46 THEME_DB_FILES
Note:
THEME_DB_IMAGES
has been renamed to
THEME_DB_FILES
. Although the legacy name,
THEME_DB_IMAGES
, is still supported, Oracle recommends using
the new name.
Use the THEME_DB_FILES
substitution string to always reference files
which are stored with your theme definition in the
database, regardless of the "File Prefix" setting
of your theme. Supported syntax for a template
substitution:
#THEME_DB_FILES#
Parent topic: Using Built-in Substitution Strings
3.10.4.47 THEME_FILES
Note:
THEME_IMAGES
has been renamed to THEME_FILES
.
Although the legacy name, THEME_IMAGES
, is still supported, Oracle
recommends using the new name.
Use the THEME_FILES
substitution string to reference files which are
stored with your theme definition. Supported syntax for a template substitution:
#THEME_FILES#
Parent topic: Using Built-in Substitution Strings
3.10.4.48 WORKSPACE_FILES
Note:
WORKSPACE_IMAGE
has been renamed to
WORKSPACE_FILES
. Although the legacy name,
WORKSPACE_IMAGE
, is still supported, Oracle recommends using
the new name.
Use this substitution string to reference uploaded images, JavaScript, and cascading style sheets that are shared over many applications within a workspace.
Reference Type | Syntax |
---|---|
Bind variable | :WORKSPACE_FILES |
Direct PL/SQL | Not available |
PL/SQL | V('WORKSPACE_FILES') |
Substitution string | &WORKSPACE_FILES. |
Template substitution | #WORKSPACE_FILES# |
See Also:
APP_FILES and APEX_FILES
Parent topic: Using Built-in Substitution Strings
3.10.4.49 WORKSPACE_ID
Use this substitution string to reference the workspace ID.
Reference Type | Syntax |
---|---|
Bind variable | :WORKSPACE_ID |
PL/SQL | V('WORKSPACE_ID') |
Substitution string | &WORKSPACE_ID. |
SYS_CONTEXT variable
|
SELECT ... WHERE workspace_id = SYS_CONTEXT('APEX$SESSION', ''WORKSPACE_ID') |
Consider the following examples:
- From within an HTML region:
Hello your workspace id is &WORKSPACE_ID.
- Using PL/SQL:
htp.p('Hello your workspace id is '||V('WORKSPACE_ID'));
- Using a bind variable:
SELECT * FROM some_table WHERE workspace_id = :WORKSPACE_ID
- Using the
SYS_CONTEXT
variable:SELECT ... WHERE workspace_id = SYS_CONTEXT('APEX$SESSION', 'WORKSPACE_ID')
APEX sets up the
APEX$SESSION
context when it starts to process an incoming request. For example, you can use the value of'WORKSPACE_ID'
to access the current workspace ID value in queries and VPD (Virtual Private Database) security policies that protect your table data.
Parent topic: Using Built-in Substitution Strings