43.4 GET_URL Function

Returns an APEX f?p= URL. It is sometimes clearer to read a function call than a concatenated URL. See the example below for a comparison.

Note:

The URL excludes a checksum if the specific application is located in a different workspace.

Syntax

APEX_PAGE.GET_URL (
    p_application        IN VARCHAR2 DEFAULT NULL,
    p_page               IN VARCHAR2 DEFAULT NULL,
    p_session            IN NUMBER   DEFAULT apex_application.g_instance,
    p_request            IN VARCHAR2 DEFAULT NULL,
    p_debug              IN VARCHAR2 DEFAULT NULL,
    p_clear_cache        IN VARCHAR2 DEFAULT NULL,
    p_items              IN VARCHAR2 DEFAULT NULL,
    p_values             IN VARCHAR2 DEFAULT NULL,
    p_printer_friendly   IN VARCHAR2 DEFAULT NULL,
    p_trace              IN VARCHAR2 DEFAULT NULL,
    p_x01                IN VARCHAR2 DEFAULT NULL,
    p_hash               IN VARCHAR2 DEFAULT NULL,
    p_triggering_element IN VARCHAR2 DEFAULT 'this',
    p_plain_url          IN BOOLEAN  DEFAULT FALSE,
    p_absolute_url       IN BOOLEAN  DEFAULT FALSE )
    RETURN VARCHAR2;

Parameters

Parameter Description
p_application The application ID or alias. Defaults to the current application.
p_page Page ID or alias. Defaults to the current page.
p_session Session ID. Defaults to the current session ID.
p_request URL request parameter.
p_debug URL debug parameter. Defaults to the current debug mode.
p_clear_cache URL clear cache parameter.
p_items Comma-delimited list of item names to set session state.
p_values Comma-separated list of item values to set session state.
p_printer_friendly URL printer-friendly parameter. Defaults to the current request's printer-friendly mode.
p_trace SQL trace parameter.
p_x01 Adds the parameter &x01=value to the URL.
p_hash Adds #hash-value at the end of the URL.
p_triggering_element A jQuery selector to identify which element to use to trigger the dialog (for example, #my_button, where "my_button" is the static ID for a button element). Required for Modal Dialog support.
p_plain_url If the page you are calling APEX_PAGE.GET_URL from is a modal dialog, specify p_plain_url to omit the unnecessary JavaScript code in the generated link. By default, if this function is called from a modal dialog, JavaScript code to close the modal dialog is included in the generated URL.
p_absolute_url If FALSE (default), auto-determines if an absolute URL is needed. If TRUE, always generates an absolute URL.

Example

This query uses APEX_PAGE.GET_URL and its alternative APEX_UTIL.PREPARE_URL to produce two identical URLs.

SELECT APEX_PAGE.GET_URL (
            p_page   => 1,
            p_items  => 'P1_X,P1_Y',
            p_values => 'somevalue,othervalue' ) f_url_1,
         APEX_UTIL.PREPARE_URL('f?p=&APP_ID.:1:&APP_SESSION.::::P1_X,P1_Y:somevalue,othervalue') f_url_2
     FROM DUAL;