Convert a token value to a readable string.
char *dbprtype(token) int token;
The server token value (SYBCHAR, SYBFLT8, and so on) returned by dbcoltype, dbalttype, dbrettype, or dbaltop.
A pointer to a null-terminated string that is the readable translation of the token value. The pointer points to space that is never overwritten, so it is safe to call this routine more than once in the same statement. If the token value is unknown, the routine returns a pointer to an empty string.
Certain routines—dbcoltype, dbalttype, dbrettype, and dbaltop—return token values representing server datatypes or aggregate operators. dbprtype provides a readable string version of a token value.
For example, dbprtype will take a dbcoltype token value representing the server binary datatype (SYBBINARY) and return the string “binary.”
Table 2-23 provides a list of the token strings that dbprtype can return and their token value equivalents.
Token string |
Token value |
Description |
---|---|---|
char |
SYBCHAR |
char datatype |
text |
SYBTEXT |
text datatype |
binary |
SYBBINARY |
binary datatype |
image |
SYBIMAGE |
image datatype |
tinyint |
SYBINT1 |
1-byte integer datatype |
smallint |
SYBINT2 |
2-byte integer datatype |
int |
SYBINT4 |
4-byte integer datatype |
float |
SYBFLT8 |
8-byte float datatype |
real |
SYBREAL |
4-byte float datatype |
numeric |
SYBNUMERIC |
numeric type |
decimal |
SYBDECIMAL |
decimal type |
bit |
SYBBIT |
bit datatype |
money |
SYBMONEY |
money datatype |
smallmoney |
SYBMONEY4 |
4-byte money datatype |
datetime |
SYBDATETIME |
datetime datatype |
smalldatetime |
SYBDATETIME4 |
4-byte datetime datatype |
boundary |
SYBBOUNDARY |
boundary type |
sensitivity |
SYBSENSITIVITY |
sensitivity type |
sum |
SYBAOPSUM |
sum aggregate operator |
avg |
SYBAOPAVG |
average aggregate operator |
count |
SYBAOPCNT |
count aggregate operator |
min |
SYBAOPMIN |
minimum aggregate operator |
max |
SYBAOPMAX |
maximum aggregate operator |