home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbwillconvert.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.7 KB  |  122 lines

  1. .Na "dbwillconvert" 
  2. .Aa
  3. .Fu
  4. Determine whether a specific datatype conversion is
  5. available within \*L.
  6. .Ih "datatype conversion"
  7. .Sy
  8. .Sf "DBBOOL dbwillconvert(srctype, desttype)"
  9. .Sp "int" "srctype"
  10. .Sp "int" "desttype"
  11. .Co
  12. .Bl
  13. This routine allows the program to determine whether
  14. \f2dbconvert()\f1 is capable of performing a specific
  15. datatype conversion.
  16. When \f2dbconvert()\f1 is asked to perform a conversion
  17. that it doesn't support, it calls a user-supplied
  18. error handler (if any), sets a global error number,
  19. and returns FAIL.
  20. .Bl
  21. \f2dbconvert()\f1 can convert data stored in
  22. any of the \*S datatypes (although, of course,
  23. not all conversions are legal):
  24. .sp
  25. .nf
  26. .in +5n
  27. .ta +25n
  28. .ne 12.5v
  29. \f3\*S type    Program variable type\f1
  30. .sp 0.5v
  31. SYBCHAR    DBCHAR
  32. .mc |
  33. SYBTEXT    DBCHAR
  34. .mc
  35. SYBBINARY    DBBINARY
  36. .mc |
  37. SYBIMAGE    DBBINARY
  38. .mc
  39. SYBINT1    DBTINYINT
  40. SYBINT2    DBSMALLINT
  41. SYBINT4    DBINT
  42. SYBFLT8    DBFLT8
  43. SYBBIT    DBBIT
  44. SYBMONEY    DBMONEY
  45. SYBDATETIME    DBDATETIME
  46. .fi
  47. .in -5n
  48. .sp
  49. .Bl
  50. The table below lists the datatype conversions that
  51. \f2dbconvert()\f1 supports.
  52. The source datatypes are listed down the leftmost column and
  53. the destination datatypes are listed along the top row of the table.
  54. (For brevity, the prefix ``SYB'' has been eliminated from
  55. each datatype.)
  56. If \f2dbwillconvert()\f1 returns TRUE (T), the conversion is
  57. supported; if it returns FALSE (F), the conversion is not supported.
  58. .Ih "datatype conversion, supported"
  59. .sp
  60. .nf
  61. .in +3n
  62. .ps -4
  63. .vs -4
  64. .ta +17n +10n +10n +10n +10n +10n +10n +10n +10n +7n +13n
  65. .ne 17.5v
  66. \f3FROM:    TO:\f1
  67. .sp 0.5v
  68. .mc |
  69. \f3            BIN-                                DATE-
  70.     CHAR    TEXT    ARY    IMAGE    INT1    INT2    INT4    FLT8    BIT    MONEY    TIME\f1
  71. .ta +19n +10n +10n +10n +10n +10n +10n +10n +9n +10n +11n
  72. .sp 0.5v
  73. \f3CHAR\f1    T    T    T    T    T    T    T    T    T    T    T
  74. .sp 0.25v
  75. \f3TEXT\f1    T    T    T    T    T    T    T    T    T    T    T
  76. .sp 0.25v
  77. \f3BINARY\f1    T    T    T    T    T    T    T    T    T    T    F
  78. .sp 0.25v
  79. \f3IMAGE\f1    T    T    T    T    T    T    T    T    T    T    F
  80. .sp 0.25v
  81. \f3INT1\f1    T    T    T    T    T    T    T    T    T    T    F
  82. .sp 0.25v
  83. \f3INT2\f1    T    T    T    T    T    T    T    T    T    T    F
  84. .sp 0.25v
  85. \f3INT4\f1    T    T    T    T    T    T    T    T    T    T    F
  86. .sp 0.25v
  87. \f3FLT8\f1    T    T    T    T    T    T    T    T    T    T    F
  88. .sp 0.25v
  89. \f3BIT\f1    T    T    T    T    T    T    T    T    T    F    F
  90. .sp 0.25v
  91. \f3MONEY\f1    T    T    T    T    T    T    T    T    T    T    F
  92. .sp 0.25v
  93. \f3DATETIME\f1    T    T    T    T    F    F    F    F    F    F    T
  94. .fi
  95. .ps +4
  96. .vs +4
  97. .in -3n
  98. .sp 0.5v
  99. .mc
  100. .Bl
  101. See the manual page for \f2dbconvert()\f1 for more information on datatype conversions.
  102. .Bz
  103. .Pa
  104. .Pi srctype
  105. The datatype of the data which is to be converted.
  106. This parameter can be any of the \*S datatypes,
  107. as listed in the first table above.
  108. .Pi desttype
  109. The datatype that the source data is to be converted into.
  110. This parameter can be any of the \*S datatypes,
  111. as listed in the first table above.
  112. .in -.375i
  113. .Re
  114. .br
  115. TRUE if the datatype conversion is supported; FALSE if the conversion 
  116. is not supported.
  117. .Sa
  118. dbaltbind,
  119. dbbind,
  120. dbconvert,
  121. types
  122.