19.2 ADD_BLUEPRINT_FROM_FILE Procedure

This procedure imports a JSON blueprint from a workspace or application file. The file should be JSON, containing a correct blueprint definition.

Syntax

APEX_DG_DATA_GEN.ADD_BLUEPRINT_FROM_FILE (
    p_filename          IN VARCHAR2,                -- name of workspace or application file   
    p_application_id    IN NUMBER   DEFAULT NULL,   -- Application ID of an Application File, or null if a workspace file
    p_override_name     IN VARCHAR2 DEFAULT NULL,   -- Name of blueprint, overrides the name provided in the file
    p_replace           IN BOOLEAN  DEFAULT FALSE,  -- return error if blueprint exist and p_replace=FALSE
    p_blueprint_id      OUT NUMBER )

Parameters

Table 19-2 ADD_BLUEPRINT_FROM_FILE Parameters

Parameter Description
p_filename Name of the file (apex_application_files.filename).
p_application_id ID of the application, or null for workspace files.
p_override_name Name of blueprint, this will override the name provided in the file.
p_replace Return error if blueprint exists and p_replace = FALSE. Will replace the blueprint (or p_override_name if provided).
p_blueprint_id ID of the imported blueprint (OUT).

Example

DECLARE
   l_blueprint number;
BEGIN
   apex_dg_data_gen.add_blueprint_from_file
     (p_filename              => 'app/example.json',  
      p_application_id        => 145,
      p_override_name         => 'My Application Blueprint',
      p_replace               => false,
      p_blueprint_id          => l_blueprint
     );
END;

DECLARE
   l_blueprint number;
BEGIN
   apex_dg_data_gen.add_blueprint_from_file
     (p_filename              => 'workspace/example.json',
      p_override_name         => 'My Workspace Blueprint',
      p_replace               => false,
      p_blueprint_id          => l_blueprint
     );
END;