ODBC Server Reference Manual

Transact-SQL Language
HP NonStop ODBC Server Reference Manual429151-002
4-75
EXECUTE
@parameter-name
is a Transact-SQL identifier. According to SQL Server rules, parameter values
without associated parameter names must be given in the order defined in the
procedure declaration. If @parameter-name is used, any sequence is allowed,
but when this form is used, it must be used for all subsequent parameters in the
EXECUTE statement.
value
is either a literal or a local variable. No other expression is permitted.
@variable [ OUT[PUT] ]
is a local variable of the procedure, defined in the same batch in which the
EXECUTE call is issued; it is a Transact-SQL identifier. If the keyword OUTPUT is
specified, the parameter is an output variable that receives a value when the
procedure is executed. By default, all parameters are considered to be input
parameters unless the keyword OUTPUT (or OUT) is specified.
WITH RECOMPILE
indicates that a less-than-optimal access plan is acceptable; it has no meaning on
the HP server and is ignored (the NonStop ODBC Server always uses the optimal
plan from among those available).
Considerations
Named and unnamed parameters can be mixed in a procedure call, but if a named
parameter is used, all subsequent parameters in the statement must also be
named or an error occurs.
If a procedure call supplies more values than the number of parameters defined in
the procedure declaration, the excess values are ignored. No error or warning
message is issued.
If values are assigned to the same named parameter more than once, only the first
value is used. No error or warning message is issued.
If a default value is specified for a parameter of a procedure (using the NonStop
ODBC Server catalog utility ADD PROCEDURE), you can execute a stored
procedure without giving a parameter value; however, the missing values must be
at the end of the parameter list. If a default value is not specified, an error message
is issued for each missing parameter. For example, the DEBIT_ACCOUNT stored
procedure can be called without any parameters, provided a default value is
defined for each of its parameters:
execute debit_account
An error occurs if a parameter is used as an OUTPUT parameter and its
corresponding definition in the procedure declaration is not INPUT/OUTPUT.