sqlca.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Licensed Materials - Property of IBM and/or HCL
  3. *
  4. * IBM Informix Dynamic Server
  5. * (c) Copyright IBM Corporation 1996, 2004 All rights reserved.
  6. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  7. *
  8. ***************************************************************************
  9. *
  10. * Title: sqlca.h
  11. * Description:
  12. * SQL Control Area
  13. *
  14. ***************************************************************************
  15. */
  16. #ifndef SQLCA_INCL
  17. #define SQLCA_INCL
  18. #include "ifxtypes.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef struct sqlca_s
  23. {
  24. int4 sqlcode;
  25. char sqlerrm[72]; /* error message parameters */
  26. char sqlerrp[8];
  27. int4 sqlerrd[6];
  28. /* 0 - estimated number of rows returned */
  29. /* 1 - serial value after insert or ISAM error code */
  30. /* 2 - number of rows processed */
  31. /* 3 - estimated cost */
  32. /* 4 - offset of the error into the SQL statement */
  33. /* 5 - rowid after insert */
  34. #ifdef _FGL_
  35. char sqlawarn[8];
  36. #else
  37. struct sqlcaw_s
  38. {
  39. char sqlwarn0; /* = W if any of sqlwarn[1-7] = W */
  40. char sqlwarn1; /* = W if any truncation occurred or
  41. database has transactions or
  42. no privileges revoked */
  43. char sqlwarn2; /* = W if a null value returned or
  44. ANSI database */
  45. char sqlwarn3; /* = W if no. in select list != no. in into list or
  46. turbo backend or no privileges granted */
  47. char sqlwarn4; /* = W if no where clause on prepared update, delete or
  48. incompatible float format */
  49. char sqlwarn5; /* = W if non-ANSI statement */
  50. char sqlwarn6; /* = W if server is in data replication secondary mode */
  51. char sqlwarn7; /* = W if database locale is different from proc_locale
  52. */
  53. } sqlwarn;
  54. #endif
  55. } ifx_sqlca_t;
  56. /* NOTE: 4gl assumes that the sqlwarn structure can be defined as
  57. * sqlawarn -- an 8 character string, because single-char
  58. * variables are not recognized in 4gl.
  59. *
  60. * If this structure should change, the code generated by 4gl compiler
  61. * must also change
  62. */
  63. #ifdef VMS
  64. noshare
  65. #endif /* VMS */
  66. #define SQLNOTFOUND 100
  67. #ifndef IFX_THREAD
  68. #ifndef SQLCODE
  69. extern struct sqlca_s sqlca;
  70. extern int4 SQLCODE;
  71. #endif /* SQLCODE */
  72. extern char SQLSTATE[];
  73. #else /* IFX_THREAD */
  74. extern int4 * ifx_sqlcode();
  75. extern struct sqlca_s * ifx_sqlca();
  76. #define SQLCODE (*(ifx_sqlcode()))
  77. #define SQLSTATE ((char *)(ifx_sqlstate()))
  78. #define sqlca (*(ifx_sqlca()))
  79. #endif /* IFX_THREAD */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* SQLCA_INCL */