19.5 ADD_DATA_SOURCE Procedure

This procedure creates a data source which identifies a table or query from which you can source data values.

Syntax

APEX_DG_DATA_GEN.ADD_DATA_SOURCE (
    p_blueprint             IN VARCHAR2,
    p_name                  IN VARCHAR2,
    p_data_source_type      IN VARCHAR2,
    p_table                 IN VARCHAR2 DEFAULT NULL,
    p_preserve_case         IN VARCHAR2 DEFAULT 'N',
    p_sql_query             IN VARCHAR2 DEFAULT NULL,
    p_where_clause          IN VARCHAR2 DEFAULT NULL,
    p_inline_data           IN CLOB     DEFAULT NULL,
    p_order_by_column       IN VARCHAR2 DEFAULT NULL,
    p_data_source_id        OUT NUMBER )

Parameters

Table 19-5 ADD_DATA_SOURCE Parameters

Parameter Description
p_blueprint Identifies the blueprint.
p_name Name of a data source. Name is upper cased and must be 26 characters or less.
p_data_source_type TABLE or SQL_QUERY.
p_table For source type = TABLE. Typically this will match p_name.
p_preserve_case Defaults to N which forces p_table_name to uppercase, if Y preserves casing of p_table.
p_sql_query For p_data_source_type = SQL_QUERY.
p_where_clause For p_data_source_type = TABLE, this adds the where clause. Do not include "where" keyword (for example, deptno <= 20).
p_inline_data For p_data_source_type = JSON_DATA.
p_order_by_column Not used.
p_data_source The ID of the added data source (OUT).

Example

DECLARE
  l_data_source_id number;
BEGIN
    apex_dg_data_gen.add_data_source(
                 p_blueprint           => 'Cars',
                 p_name                => 'apex_dg_builtin_cars',
                 p_data_source_type    => 'TABLE',
                 p_table               => 'apex_dg_builtin_cars',
                 p_data_source_id      => l_data_source_id  );
END;