Batch Apply Procedure with Input SQL and Output Tables or Views

This procedure applies a model where the input is one or more SQL queries and the output is tables or views.

Syntax

PROCEDURE apply_procedure_name_ST(
      case_sql          IN VARCHAR2,
      additional_sql_1  IN VARCHAR2,
      additional_sql_n  IN VARCHAR2,
      model_name        IN VARCHAR2 DEFAULT activity_default,
      feature_table     IN VARCHAR2 DEFAULT activity_default,
      apply_result_name IN VARCHAR2 DEFAULT activity_default,
      table_output      IN BOOLEAN DEFAULT TRUE,
      drop_output       IN BOOLEAN DEFAULT user_defined);

Parameters and Defaults

The procedure has two kinds of defaults:

Table 1 Batch Apply with Input SQL Queries and Output Tables or Views Procedure Parameters

Parameter Description
apply_procedure_name_ST The name specified for the procedure when the code was generated with the _ST suffix added.
case_sql A SQL query that returns valid case data for the model being applied.
additional_sql_1 The first SQL query that returns valid additional data. This parameter is optional.
additional_sql_n The n-th SQL query that returns valid additional data. This parameter is optional.
model_name The name of the model being applied.
feature_table Feature ID to text mapping table generated by the text transform. Can be used to translate model detail output containing columns affected by a text transformation.
apply_result_name The name of apply result table or view created by the procedure. The name is in the form schema_name.table_name.
table_output The default value TRUE indicates that the output of the procedure is a table or view.
drop_output A flag indicating whether to drop the output if it already exists. The value of this flag was specified when the code was generated.

Usage Notes

This procedure includes all necessary data preparation, data transformations, and apply settings. The procedure creates an apply output table or view. If the output already exists and drop_output is set to FALSE, the procedure will raise an exception to the caller and exit.

You must provide at least one query that returns valid case table data for the model being applied.

You can supply a feature_table name different from the default name, but you must supply the same name in both Build and Apply procedures.

Example

  MYAPPLY_ST(
               case_sql => 'SELECT * FROM SH.CUSTOMERS WHERE AGE > 25',
               additional_sql_1 => 'SELECT * FROM SH.SUPPLEMENTARY_DEMOGRAPHICS',
               additional_sql_2 => 'SELECT * FROM SH.SALES');