37.14 GET_CURRENT_DATABASE_TYPE Function

This function retrieves the database type for the currently active region. If Plug-In developers generate SQL in their code, this information helps to generate correct SQL for the corresponding database type.

Syntax

APEX_PLUGIN_UTIL.GET_CURRENT_DATABASE_TYPE (
    p_remote_server_id  IN NUMBER   DEFAULT NULL )
    RETURN apex_exec.t_database_type;

Parameters

Table 37-15 GET_CURRENT_DATABASE_TYPE Parameters

Parameter Description
p_remote_server_id The internal ID of the REST Enabled SQL reference.

Returns

This function returns the database vendor for the data source of the currently executed region.

Example

The following example demonstrates

DECLARE
    l_database_type apex_exec.t_database_type;
BEGIN
    l_database_type := apex_plugin_util.get_current_database_type;
    IF l_database_type = apex_exec.c_database_mysql THEN
        -- MySQL specific code goes here
    ELSE
        -- normal code goes here
    END IF;
END;