ODBC Server Reference Manual

Transact-SQL Language
HP NonStop ODBC Server Reference Manual429151-002
4-74
EXECUTE
EXECUTE
Use EXECUTE to invoke a previously defined stored procedure (a Pathway server
class program).
The EXECUTE statement has the following syntax:
@return-status
is a local variable that returns a code indicating the completion status of the stored
procedure execution. The completion codes are defined by the Pathway
programmer. The data type of @return-status is as declared in the batch prior
to the EXECUTE command. The data type must be of type INTEGER or
SMALLINT. The default data type is SMALLINT.
If the procedure returns a value, the batch where the stored procedure is called
should include a @return-status local variable declared as numeric. Note that a
data conversion error might occur if the local variable declared is not exactly of
type INTEGER. The reply to the NonStop ODBC Server from the
Serverclass_Send message indicates the return variable’s value.
The EXEC[UTE] keyword may be omitted if the statement is the first one in a
batch.
[server.] [ [database.]owner. ] procedure-name[;number]
[ database.. ]
identifies the stored procedure. If the server name is included, the NonStop
ODBC Server ignores it; the NonStop ODBC Server does not support four-part
names. The database, owner, and procedure-name portions of the name are
described under Names on page 4-5. A procedure name may optionally begin with
an underscore (_) character.
The number that can optionally be appended to the procedure name identifies a
specific procedure within a group of procedures having the same name; if omitted,
it defaults to 1. It is recommended that number not be used as part of the
procedure name if the procedure is intended to be shared by both Transact-SQL
and CORE SQL users.
[ EXEC[UTE] ] [ @return-status = ]
[server.] [ [database.]owner. ] procedure-name[;number]
[ database.. ]
[ [@parameter-name =] { value, } [, ...]
]
{ @variable [ OUT[PUT] ] }
[ WITH RECOMPILE ]