Callable Routines API

WhereScape RED callable routines provide an Application Program Interface (API) to the WhereScape RED metadata using the following SQL-invoked routines:

Routine NameDescription
Ws_Api_GlossaryAdds an entry to the documentation glossary.
Ws_Connect_Replace Replaces the contents of a connection with details from another connection.
Ws_Load_Change Changes the Connection or Schema of a load table.
Ws_Version_ClearPurges metadata versions for all objects that do not meet the specified retention criteria.
WsParameterRead Returns the value and comment (for most RDBMS) of a WhereScape RED metadata Parameter.
WsParameterReadFReturns the value of a WhereScape RED metadata Parameter.
WsParameterReadG Returns the value of a "global" WhereScape RED metadata Parameter that relates to a load table.
WsParameterWrite Updates the value and comment of a WhereScape RED metadata Parameter or creates it.
WsWrkAudit Records a message in the Audit Log.
WsWrkAuditBulk Records multiple messages in the Audit Log.
WsWrkError Records a message in the Error/Detail Log.
WsWrkErrorBulkRecords multiple messages in the Error/Detail Log.
WsWrkTaskUpdates row counts for a task in the Task Log.

Callable Routines Names Qualifier

For PostgreSQL, it is necessary to qualify the routine name with the schema name 'red' of the WhereScape RED metadata repository. All RED-generated procedures in a PostgreSQL repository that invoke a WhereScape RED Callable Routine do so by qualifying the routine name with [METABASE] e.g. [METABASE].routine_name.

Callable Routines Common Input

The following input parameters are common to most of the WhereScape RED Callable Routines, which are primarily used for integration with the WhereScape RED Scheduler.

InputParameter NameDescription
Job Instance Identifierp_sequenceUnique identifier of the running job (i.e. the running instance of a held or scheduled job) that executed the routine.
  • When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument.
  • When invoked manually or externally to the WhereScape RED Scheduler, then any integer value can be used.
Job Namep_job_nameName of the running job that executed the routine.
  • When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument.
  • When invoked manually or externally to the WhereScape RED Scheduler, then any name can be used.
Task Namep_task_nameName of the running task (of a running job) that executed the routine.
  • When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument.
  • When invoked manually or externally to the WhereScape RED Scheduler, then any name can be used.
Job Identifierp_job_idUnique identifier of the held or scheduled job that the running job is a specific instance of.
  • When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument.
  • When invoked manually or externally to the WhereScape RED Scheduler, it is recommended to use 0 (zero).
Task Identifier        p_task_idUnique identifier of the running task (of a running job) that executed the routine.
  • When invoked from a WhereScape RED Scheduler the routine will be passed the parameter argument.
  • When invoked manually or externally to the WhereScape RED Scheduler, it is recommended to use 0 (zero).

Typically, the parameter names of the WhereScape RED Callable Routines use a p_ prefix as indicated but in some routines, a v_ prefix is used instead.


  • No labels