sqlca.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef POSTGRES_SQLCA_H
  2. #define POSTGRES_SQLCA_H
  3. #ifndef PGDLLIMPORT
  4. #if defined(WIN32) || defined(__CYGWIN__)
  5. #define PGDLLIMPORT __declspec (dllimport)
  6. #else
  7. #define PGDLLIMPORT
  8. #endif /* __CYGWIN__ */
  9. #endif /* PGDLLIMPORT */
  10. #define SQLERRMC_LEN 150
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15. struct sqlca_t
  16. {
  17. char sqlcaid[8];
  18. long sqlabc;
  19. long sqlcode;
  20. struct
  21. {
  22. int sqlerrml;
  23. char sqlerrmc[SQLERRMC_LEN];
  24. } sqlerrm;
  25. char sqlerrp[8];
  26. long sqlerrd[6];
  27. /* Element 0: empty */
  28. /* 1: OID of processed tuple if applicable */
  29. /* 2: number of rows processed */
  30. /* after an INSERT, UPDATE or */
  31. /* DELETE statement */
  32. /* 3: empty */
  33. /* 4: empty */
  34. /* 5: empty */
  35. char sqlwarn[8];
  36. /* Element 0: set to 'W' if at least one other is 'W' */
  37. /* 1: if 'W' at least one character string */
  38. /* value was truncated when it was */
  39. /* stored into a host variable. */
  40. /*
  41. * 2: if 'W' a (hopefully) non-fatal notice occurred
  42. */ /* 3: empty */
  43. /* 4: empty */
  44. /* 5: empty */
  45. /* 6: empty */
  46. /* 7: empty */
  47. char sqlstate[5];
  48. };
  49. struct sqlca_t *ECPGget_sqlca(void);
  50. #ifndef POSTGRES_ECPG_INTERNAL
  51. #define sqlca (*ECPGget_sqlca())
  52. #endif
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif