Determines the datatype of a return-parameter value generated by a stored procedure or a remote stored procedure.
INT dbrettype (
PDBPROCESS dbproc,
INT retnum );
where
A token value for the datatype of the specified return value.
Column datatype |
Returned constant |
---|---|
char | SQLCHAR |
varchar | SQLCHAR |
binary | SQLBINARY |
varbinary | SQLBINARY |
tinyint | SQLINT1 |
smallint | SQLINT2 |
int | SQLINT4 |
real | SQLFLT4 |
float | SQLFLT8 |
smallmoney | SQLMONEY4 |
money | SQLMONEY |
decimal | SQLDECIMAL |
numeric | SQLNUMERIC |
smalldatetime | SQLDATETIM4 |
datetime | SQLDATETIME |
If retnum is out of range, -1 is returned.
For more information about stored procedure return parameters, see "dbretdata."
The server returns stored procedure information (including any return status and parameter values) immediately after returning all normal results for that stored procedure. Process the normal results, and then call dbrettype after dbresults returns NO_MORE_RPC_RESULTS (for all stored procedures in a batch except the last one) or NO_MORE_RESULTS (for a single stored procedure, or for the last stored procedure in a batch).
The dbrettype function actually returns an integer token value for the datatype (SQLCHAR, SQLFLT8, and so on). To convert the token value into a readable token string, use dbprtype. For a list of all token values and their equivalent token strings, see dbprtype. For a list of SQL Server datatypes, see Appendix B: DB-Library Datatypes.
dbnextrow, dbnumrets, dbprtype, dbresults, dbretdata, dbretlen, dbretname, dbrpcinit, dbrpcparam