Skip to main content

EnsLib.SQL.Operation.ProcOperation

class EnsLib.SQL.Operation.ProcOperation extends EnsLib.SQL.Operation.GenericOperation

This Operation calls out to a SQL Procedure and generates its response message based on any output parameters returned by the procedure. This Operation should only be used for Function type Procedures. For Query type Procedures, use EnsLib.SQL.Operation.GenericOperation.

Property Inventory

Method Inventory

Parameters

parameter SETTINGS = -Query,Procedure:Data,InputParameters:Data:sqlParametersTable?querySetting=HostProcedure&classSettingName=HostRequestClass&prependAsterix=1,IO:Data,ParamSQLTypes:Data,OutputParamNames:Data:sqlParametersTable?querySetting=HostProcedure&classSettingName=HostResponseClass,EscapedCallRequiresBracing:Data;
Inherited description: List of properties can be set as settings in the configuration file format is a comma separated list of property names

Properties

property EscapedCallRequiresBracing as %Boolean [ InitialExpression = 1 ];
JDBC escape call syntax requires the statement to be wrapped in {}
Property methods: EscapedCallRequiresBracingDisplayToLogical(), EscapedCallRequiresBracingGet(), EscapedCallRequiresBracingIsValid(), EscapedCallRequiresBracingLogicalToDisplay(), EscapedCallRequiresBracingNormalize(), EscapedCallRequiresBracingSet()
property IO as %String;
A text string in which each character corresponds to one of the query parameters. The character 'i' means the corresponding parameter is an Input parameter. The character 'o' means it is an Output parameter, and 'b' means it is Both an Input and an Output parameter. If the procedure is a function which has a return value, an 'o' should be added in front to account for the return value.
Property methods: IODisplayToLogical(), IOGet(), IOIsValid(), IOLogicalToDisplay(), IOLogicalToOdbc(), IONormalize(), IOSet()
property OnlyWarnOnce as %Boolean [ InitialExpression = 1 ];
Limit warnings about multiple returned rows and truncated data.
Give a warning the first time that a call to this Operation returns multiple rows, but do not repeat the warning if any subsequent calls also return multiple rows. Likewise, give one warning per column or output parameter if AllowTruncating is true and returned values must be truncated.
This is only relevant when ResponseClass is set because these warning are not issued for json response messages.
Property methods: OnlyWarnOnceDisplayToLogical(), OnlyWarnOnceGet(), OnlyWarnOnceIsValid(), OnlyWarnOnceLogicalToDisplay(), OnlyWarnOnceNormalize(), OnlyWarnOnceSet()
property OutputParamNames as %String);
A comma-separated list of property names corresponding to any output parameters of the procedure. Each parameter with an IO type of either 'o' or 'b' should have a name specified if this Operation will be generating a response message.
Property methods: OutputParamNamesDisplayToLogical(), OutputParamNamesGet(), OutputParamNamesIsValid(), OutputParamNamesLogicalToDisplay(), OutputParamNamesLogicalToOdbc(), OutputParamNamesNormalize(), OutputParamNamesSet()
property ParamSQLTypes as %String);
A comma-separated list of the SQL data types of each parameter used in the query (eg. SQL_CHAR,SQL_INTEGER). This list should include both input and output parameters. This may be required for the query to execute successfully if the datatype are not SQL_VARCHAR (the default used when unspecified)
Property methods: ParamSQLTypesDisplayToLogical(), ParamSQLTypesGet(), ParamSQLTypesIsValid(), ParamSQLTypesLogicalToDisplay(), ParamSQLTypesLogicalToOdbc(), ParamSQLTypesNormalize(), ParamSQLTypesSet()
property Procedure as %String);
The name of the procedure to be called by this Operation. This should include any ? characters used to indicate parameters of the procedure, but should not include any SQL commands (eg. Select) with the exception that the CALL command must be included if ?= is used.
Specifying preceding ?=CALL is optional if the procedure provides a RETURN (Note the Input/Output Setting must include the leading o for the return.)
For example the following are valid:

schema.proc(?,?) with Input/Output of oii - this will result in ? = CALL schema.proc(?,?)
schema.proc(?,?) with Input/Output of ii - this will result in CALL schema.proc(?,?)
? = CALL schema.proc(?,?) with Input/Output of oii - this will result in ? = CALL schema.proc(?,?)
CALL schema.proc(?,?) with Input/Output of ii - this will result in CALL schema.proc(?,?)
Property methods: ProcedureDisplayToLogical(), ProcedureGet(), ProcedureIsValid(), ProcedureLogicalToDisplay(), ProcedureLogicalToOdbc(), ProcedureNormalize(), ProcedureSet()
property ResponseClass as %String (MAXLEN = 1000);
Message class to use in generating the response object. If this is set and the query has any output parameters, then a response object of this class will be created and the values from the output parameters will be set into the corresponding properties of the response object. The OutputParamNames setting must be used in order to pair the output parameters with properties of the message class. If no ResponseClass is specified, then the response object will take the form of an Ens.StreamContainer message with the Stream property containing a json string with any output parameter values.
Property methods: ResponseClassDisplayToLogical(), ResponseClassGet(), ResponseClassIsValid(), ResponseClassLogicalToDisplay(), ResponseClassLogicalToOdbc(), ResponseClassNormalize(), ResponseClassSet()

Methods

method OnInit() as %Status
Inherited description: This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
method OnMessage(pRequest As Ens.Request, Output pResponse As Ens.Response) as %Status
Inherited description: This is the default message handler. All request types not declared in the message map are delivered here

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab