Returns the data type for a compute column.
INT dbalttype (
PDBPROCESS dbproc,
INT computeid,
INT column );
The type of the data for the particular column in the compute. The types are defined as follows:
Column data type | 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 |
image | SQLIMAGE |
text | SQLTEXT |
Call dbalttype only after dbnextrow or dbgetrow returns a computeid.
If either the computeid or column is invalid, -1 is returned.
In the following SELECT statements, calling dbalttype(dbproc, 1, 1) returns the type for SQLINT4 because counts are of SQLINT4 type.
SELECT dept, name FROM employee
ORDER BY dept, name
COMPUTE COUNT(name) BY dept
To convert the type to a readable string, use dbprtype.
DB-Library for C Data Types | dbgetrow |
dbadata | dbnextrow |
dbadlen | dbnumalts |
dbaltlen | dbprtype |