Export (0) Print
Expand All

2.2.7.17 RETURNVALUE

Token Stream Name:

RETURNVALUE

Token Stream Function:

Used to send the return value of an RPC to the client. When an RPC is executed, the associated parameters might be defined as input or output (or "return") parameters. This token is used to send a description of the return parameter to the client. This token is also used to describe the value returned by a UDF when executed as an RPC.

Token Stream Comments:

  • The token value is 0xAC.

  • Multiple return values can exist per RPC. There is a separate RETURNVALUE token sent for each parameter returned.

  • Large Object output parameters are reordered to appear at the end of the stream. First the group of small parameters is sent, followed by the group of large output parameters. There is no reordering within the groups.

  • A UDF cannot have return parameters. As such, if a UDF is executed as an RPC there is exactly one RETURNVALUE token sent to the client.

Token Stream-Specific Rules:


TokenType        =   BYTE
ParamName        =   B_VARCHAR
ParamOrdinal     =   USHORT
Status           =   BYTE
UserType         =   USHORT/ULONG; (Changed to ULONG in TDS 7.2)


fNullable        =   BIT
fCaseSen         =   BIT
usUpdateable     =   2BIT            ; 0 = ReadOnly
                                     ; 1 = Read/Write
                                     ; 2 = Unused

fIdentity        =   BIT
fComputed        =   BIT             ; (introduced in TDS 7.2)
usReservedODBC   =   2BIT
fFixedLenCLRType =   BIT             ; (introduced in TDS 7.2)
usReserved       =   7BIT

Flags            =   fNullable
                     fCaseSen
                     usUpdateable
                     fIdentity
                     (FRESERVEDBIT / fComputed)
                     usReservedODBC
                     (FRESERVEDBIT / fFixedLenCLRType)
                     usReserved

TypeInfo         =   TYPE_INFO
Value            =   TYPE_VARBYTE

Token Stream Definition:


RETURNVALUE      =   TokenType
                     ParamOrdinal
                     ParamName
                     Status
                     UserType
                     Flags
                     TypeInfo
                     Value

Token Stream Parameter Details:

Parameter

Description

TokenType

RETURNVALUE_TOKEN

ParamOrdinal

Indicates the ordinal position of the output parameter in the original RPC call. Large Object output parameters are reordered to appear at the end of the stream. First the group of small parameters is sent, followed by the group of large output parameters. There is no reordering within the groups.

ParamName

The parameter name length and parameter name (within B_VARCHAR).

Status

0x01: If ReturnValue corresponds to OUTPUT parameter of a stored procedure invocation.

0x02: If ReturnValue corresponds to return value of User Defined Function.

UserType

The user-defined data type of the column. The value will be 0x00 00 with the exceptions of TIMESTAMP (0x00 50) and alias types (> 0x00 FF).

Flags

These bit flags are described in least significant bit order. All of these bit flags SHOULD be set to zero. For a description of each bit flag, see section 2.2.7.4.

  • fCaseSen

  • fNullable

  • usUpdateable

  • fIdentity

  • fComputed

  • usReservedODBC

  • fFixedLengthCLRType

TypeInfo

The TYPE_INFO for the message.

Value

The type-dependent data for the parameter (within TYPE_VARBYTE).

 
Show:
© 2014 Microsoft