1 Version 4.0 -- 5/1/89 dbwillconvert
______________________________________________________________________
NAME: dbwillconvert
FUNCTION:
Determine whether a specific datatype conversion is available
within DB-Library.
SYNTAX:
DBBOOL dbwillconvert(srctype, desttype)
int srctype;
int desttype;
dbwillconvert Version 4.0 -- 5/1/89 2
______________________________________________________________________
COMMENTS:
o This routine allows the program to determine whether dbcon-
vert() is capable of performing a specific datatype conversion.
When dbconvert() is asked to perform a conversion that it
doesn't support, it calls a user-supplied error handler (if
any), sets a global error number, and returns FAIL.
o dbconvert() can convert data stored in any of the SQL Server
datatypes (although, of course, not all conversions are legal):
3 Version 4.0 -- 5/1/89 dbwillconvert
______________________________________________________________________
SQL Server type Program variable type
SYBCHAR DBCHAR
SYBTEXT DBCHAR
SYBBINARY DBBINARY
SYBIMAGE DBBINARY
SYBINT1 DBTINYINT
SYBINT2 DBSMALLINT
SYBINT4 DBINT
SYBFLT8 DBFLT8
SYBBIT DBBIT
SYBMONEY DBMONEY
SYBDATETIME DBDATETIME
o The table below lists the datatype conversions that dbconvert()
supports. The source datatypes are listed down the leftmost
column and the destination datatypes are listed along the top
dbwillconvert Version 4.0 -- 5/1/89 4
______________________________________________________________________
row of the table. (For brevity, the prefix "SYB" has been
eliminated from each datatype.) If dbwillconvert() returns TRUE
(T), the conversion is supported; if it returns FALSE (F), the
conversion is not supported.
FROM: TO: BIN- DATE-
CHAR CHA
TR TET
XT ART
Y IMA
TGE INT1 INT2 INT4 FLT8 BI
TT MONET
Y TIM
TE
B
TE
IN
XA
TRY T T T T T T T T T T F
T
IM
NA
T1
GE T T T T T T T T T T F
INT2
4 T T T T T T T T T T F
B
FI
LT8 T T T T T T T T T F
T F
D
MA
ON
TET
YIME T T T T F
T F
T F
T F
T F
T F
T F
T
o See the manual page for dbconvert() for more information on
datatype conversions.
PARAMETERS:
5 Version 4.0 -- 5/1/89 dbwillconvert
______________________________________________________________________
srctype - The datatype of the data which is to be converted.
This parameter can be any of the SQL Server datatypes, as
listed in the first table above.
desttype - The datatype that the source data is to be converted
into. This parameter can be any of the SQL Server datatypes,
as listed in the first table above.
RETURNS:
TRUE if the datatype conversion is supported; FALSE if the
conversion is not supported.
SEE ALSO:
dbaltbind, dbbind, dbconvert, types