Using a stored procedure as an input

Stored procedures can be used in input cards by specifying the call in the Query field in the New Query dialog of the Database Interface Designer.

After the stored procedure call is entered in the New Query dialog or the Edit/View Query dialog (if you are editing an existing query), you can generate a type tree for the stored procedure.

Generated type trees for stored procedures adhere to the same format as type trees for queries and will contain a Row group, the components of which correspond to the ? placeholders in the CALL statement. Return values from stored functions will typically have the field name RETURN_VALUE unless the database returns a specific name.

The call syntax for a stored procedure can be used effectively in input cards in combination with substitution variables to provide values to input parameters. For example, to call GetPaymentInfo in an input card, because GetPaymentInfo takes a single input parameter, first define the text in the Query field.

Next, provide the value on the command line for parm1 at execution time as follows:

dtx MyMap.mmc -ID1 '-VAR parm1=2000-03-11'