19.10 GENERATE_DATA_INTO_COLLECTION Procedure

This procedure generates the data of the specified blueprint and stores the results in an APEX collection named APEX$DG$[BLUEPRINT_NAME].

Syntax

APEX_DG_DATA_GEN.GENERATE_DATA_INTO_COLLECTION (
    p_blueprint            IN         VARCHAR2,
    p_format               IN         VARCHAR2,
    p_blueprint_table      IN         VARCHAR2 DEFAULT NULL,
    p_row_scaling          IN         NUMBER DEFAULT 100,
    p_stop_after_errors    IN         NUMBER DEFAULT c_max_error_count,
    p_errors               OUT NOCOPY CLOB )

Parameters

Table 19-10 GENERATE_DATA_INTO_COLLECTION Parameters

Parameter Description
p_blueprint Name of the blueprint.
p_format

SQL INSERT outputs a sql script.

CSV outputs a single CSV for one table or a ZIP of CSVs for multiple tables.

JSON outputs JSON file.

INSERT INTO generates the SQL INSERT script and runs the insert statements in the current schema.

FAST INSERT INTO generates the data and does a single INSERT ... into [table] SELECT ... from [temporary table]

p_blueprint_table

This value is case sensitive.

Null for all tables. If not null, generates data only for designated table. If not null, must be table name of a table within the blueprint.

p_row_scaling Scales the number of rows defined into the blueprint by this percentage value.
p_stop_after_errors Defines the number of errors that can happen before the process is stopped. Only applies to INSERT INTO.
p_errors JSON output of any errors. NULL upon success.

Output is stored in the collection. Additionally, a new row within the same collection contains the error message if there is none.

Output Description
CLOB001 The clob to hold the output. Null for INSERT INTO and FAST INSERT INTO.
BLOB001 The blob to hold the output. Null for INSERT INTO and FAST INSERT INTO.
C006 The file extension of the output. Null for INSERT INTO and FAST INSERT INTO.
C007 The mime type of the output. Null for INSERT INTO and FAST INSERT INTO.
C001 'ERROR'
CLOB001 JSON output of any errors. NULL upon success.

Example

DECLARE
    l_errors    clob;
BEGIN
    apex_dg_output.generate_data_into_collection
        (p_blueprint          => 'Cars',
         p_blueprint_table    => 'my_cars',
         p_stop_after_errors  => 100,
         p_errors             => l_errors
        );
END;