39.5 GET_SYNC_TABLE_DEFINITION_SQL Function

This function generates SQL to synchronize the local table definition with the data profile.

Syntax

APEX_REST_SOURCE_SYNC.GET_SYNC_TABLE_DEFINITION_SQL (
    p_module_static_id      IN VARCHAR2,
    p_application_id        IN NUMBER   DEFAULT {current application id},
    p_include_drop_columns  IN BOOLEAN  DEFAULT FALSE )
    RETURN VARCHAR2;

Parameters

Table 39-5 APEX_REST_SOURCE_SYNC.GET_SYNC_TABLE_DEFINITION_SQL Parameters

Parameter Description
p_module_static_id Static ID to identify the REST Data Source.
p_application_id (Optional) The application ID.
p_include_drop_columns If TRUE, generate ALTER TABLE DROP COLUMN statements for columns which do not exist in the data profile any more.

Example

The following example generates the SQL statements (ALTER TABLE) to bring the table in sync with the data profile after the REST Data Source named "rest_movie" has changed.

DECLARE
    l_sql varchar2(32767);
BEGIN
    apex_session.create_session(
        p_app_id          => 100,
        p_app_page_id     => 1,
        p_username        => '...' );
    l_sql := apex_rest_source_sync.get_sync_table_definition_sql(
        p_module_static_id      => 'rest_movie',
        p_include_drop_columns  => true );
END;