Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Sybase DB Library C 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

  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
T
R TET
X
T ART
Y
IMA
T
GE INT1 INT2 INT4 FLT8 BI
T
T MONET
Y
TIM
T
E B
T
E
I
N
X
A
T
RY T T T T T T T T T T F
T
IM
N
A
T
1
G
E 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
F
I
L
T8 T T T T T T T T T F
T
F D
M
A
O
N
T
ET
Y
IME 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

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026