home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / auto / DBI / dbi_sql.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-10  |  1.5 KB  |  51 lines

  1. /* $Id: dbi_sql.h,v 1.1 1997/07/22 23:17:50 timbo Exp $
  2.  *
  3.  * Copyright (c) 1997 Tim Bunce
  4.  *
  5.  * You may distribute under the terms of either the GNU General Public
  6.  * License or the Artistic License, as specified in the Perl README file.
  7.  */
  8.  
  9.  
  10. /* Some core SQL CLI standard (ODBC) declarations        */
  11. #ifndef SQL_SUCCESS    /* don't clash with ODBC based drivers    */
  12.  
  13. /* Standard SQL datatypes (ANSI/ODBC type numbering)        */
  14. #define    SQL_CHAR        1    /*    DBI_CHAR     */
  15. #define    SQL_NUMERIC        2
  16. #define    SQL_DECIMAL        3
  17. #define    SQL_INTEGER        4    /*    DBI_INTEGER    */
  18. #define    SQL_SMALLINT        5
  19. #define    SQL_FLOAT        6    /*    DBI_FLOAT    */
  20. #define    SQL_REAL        7
  21. #define    SQL_DOUBLE        8
  22. #define    SQL_VARCHAR        12    /*    DBI_VARCHAR    */
  23.  
  24. #ifdef just_for_pondering /* not used yet, just here for pondering */
  25. #define SQL_DATE           9
  26. #define SQL_TIME           10
  27. #define SQL_TIMESTAMP      11
  28. #define SQL_LONGVARCHAR    (-1)
  29. #define SQL_BINARY         (-2)
  30. #define SQL_VARBINARY      (-3)
  31. #define SQL_LONGVARBINARY  (-4)
  32. #define SQL_BIGINT         (-5)
  33. #define SQL_TINYINT        (-6)
  34. #endif
  35.  
  36. /* Main return codes                        */
  37. #define    SQL_ERROR            (-1)
  38. #define    SQL_SUCCESS            0
  39. #define    SQL_SUCCESS_WITH_INFO        1
  40. #define    SQL_NO_DATA_FOUND        100
  41.  
  42. #endif    /*    SQL_SUCCESS    */
  43.  
  44. /* Handy macro for testing for success and success with info.        */
  45. /* BEWARE that this macro can have side effects since rc appears twice!    */
  46. /* So DONT use it as if(SQL_ok(func(...))) { ... }            */
  47. #define SQL_ok(rc)    ((rc)==SQL_SUCCESS || (rc)==SQL_SUCCESS_WITH_INFO)
  48.  
  49.  
  50. /* end of dbi_sql.h */
  51.