home *** CD-ROM | disk | FTP | other *** search
-
- 1 Version 4.0 -- 5/1/89 dbalttype
- ______________________________________________________________________
-
- NAME: dbalttype
-
- FUNCTION:
- Return the datatype for a compute column.
-
- SYNTAX:
- int dbalttype(dbproc, computeid, column)
-
- DBPROCESS *dbproc;
- int computeid;
- int column;
-
-
-
-
-
-
-
-
- dbalttype Version 4.0 -- 5/1/89 2
- ______________________________________________________________________
-
- COMMENTS:
-
- o This routine returns the datatype for a compute column. For a
- list of SQL Server datatypes, see the manual page for types.
- o dbalttype() actually returns an integer token value for the
- datatype (SYBCHAR, SYBFLT8, etc.). To convert the token value
- into a readable token string, use dbprtype(). See the
- dbprtype() manual page for a list of all token values and their
- equivalent token strings.
-
- o For example, given the SQL statement:
-
- select dept, name from employee
- order by dept, name
- compute count(name) by dept
-
- the call dbalttype(dbproc, 1, 1) will return the token value
-
-
- 3 Version 4.0 -- 5/1/89 dbalttype
- ______________________________________________________________________
- SYBINT4, because counts are of SYBINT4 type. dbprtype() will
- convert SYBINT4 into the readable token string "int".
-
- PARAMETERS:
- dbproc - A pointer to the DBPROCESS structure that provides the
- connection for a particular front end/SQL Server process. It
- contains all the information that DB-Library uses to manage
- communications and data between the front end and SQL Server.
- computeid - The id that identifies the particular compute row of
- interest. A SQL SELECT statement may have multiple COMPUTE
- clauses, each of which returns a separate compute row. The
- computeid corresponding to the first COMPUTE clause in a
- SELECT is 1. The computeid is returned by dbnextrow() or
- dbgetrow().
- column - The number of the column of interest. The first column
- is number 1.
-
-
-
-
- dbalttype Version 4.0 -- 5/1/89 4
- ______________________________________________________________________
-
- RETURNS:
- A token value for the datatype for a particular compute column.
-
- In a few cases, the token value returned by this routine may not
- correspond exactly with the column's SQL Server datatype:
- o SYBVARCHAR is returned as SYBCHAR.
-
- o SYBVARBINARY is returned as SYBBINARY.
- o SYBDATETIMN is returned as SYBDATETIME.
-
- o SYBMONEYN is returned as SYBMONEY.
- o SYBFLTN is returned as SYBFLT8.
-
- o SYBINTN is returned as SYBINT1, SYBINT2, or SYBINT4, depending
- on the actual type of the SYBINTN.
- dbalttype() returns -1 if either the computeid or the column are
-
-
-
- 5 Version 4.0 -- 5/1/89 dbalttype
- ______________________________________________________________________
- invalid.
-
- SEE ALSO:
- dbadata, dbadlen, dbaltlen, dbnextrow, dbnumalts, dbprtype, types
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-