1

I am getting errors while trying to run Informix CDC api.

  1. I copied the code https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.cdc.doc/ids_cdc_060.htm into cdcapi_INFORMIX.ec

  2. Ran as informix user login, I am getting error CDC_ERRORCODE = CDC_E_APIVERS I got few warnings while compiling the program but it compiled into a program CDCEXE. But doent seem to work. Could anyone provide me few pointers

check_version csdk Currently installed version: 3.50.FC5

ifx_getversion dmi IBM/Informix-Client SDK Version 3.50.FC5

ifx_getversion esql IBM/Informix-Client SDK Version 3.50.FC5 IBM/Informix EMBEDDED SQL for C Version 3.50.FC5 Copyright (C) 1991-2009 IBM

esql -g -static -o CDCEXE cdcapi_INFORMIX.ec /opt/inf/sdk/lib/dmi/libdmi.a "cdcapi_INFORMIX.ec", line 492: warning #2223-D: function "ldlong" declared implicitly c_int8.data[0] = ldlong(databuf+INT8_LO_OFFSET); ^

"cdcapi_INFORMIX.ec", line 558: warning #2223-D: function "ldbigint" declared implicitly ldbigintx(&c_bigint, databuf); ^

"cdcapi_INFORMIX.ec", line 587: warning #2223-D: function "lddecimal" declared implicitly lddecimal(databuf, coldesc.colobj[col].colsize, &c_decimal); ^

"cdcapi_INFORMIX.ec", line 687: warning #2223-D: function "rtypsize" declared implicitly colsize = rtypsize(sqlda->sqlvar[col].sqltype, ^

"cdcapi_INFORMIX.ec", line 747: warning #2223-D: function "ldlong" declared implicitly lsn_hi = ldlong(databuf + TRUNCATE_LSN_HI_OFFSET); ^

"cdcapi_INFORMIX.ec", line 778: warning #2223-D: function "ldlong" declared implicitly tabid = ldlong(databuf+TABSCHEMA_USERDATA_OFFSET); ^

"cdcapi_INFORMIX.ec", line 873: warning #2223-D: function "ldlong" declared implicitly lsn_hi = ldlong(databuf + TXN_LSN_HI_OFFSET); ^

"cdcapi_INFORMIX.ec", line 908: warning #2223-D: function "ldlong" declared implicitly lsn_hi = ldlong(databuf + DISCARD_LSN_HI_OFFSET); ^

"cdcapi_INFORMIX.ec", line 947: warning #2223-D: function "ldlong" declared implicitly lsn_hi = ldlong(databuf + IUD_LSN_HI_OFFSET); ^

"cdcapi_INFORMIX.ec", line 1019: warning #2223-D: function "ldlong" declared implicitly cur_log_header.ch_size_hdr = ldlong(a_recordbuf); ^

"cdcapi_INFORMIX.ec", line 1342: warning #2549-D: variable "recptr" is used before its value is set memcpy(databuf, recptr, bytes_left_over_in_previous_buf); ^

"cdcapi_INFORMIX.ec", line 1387: warning #2223-D: function "ldlong" declared implicitly hdrsize = ldlong(recptr);


Ran the program as

./CDCEXE -D db1 -T "bill.t1" -C "a,b" -T t2 -C "a,c" INFORMIXSERVER [server1] Connected to syscdcv1@server1 CDC_OPENSESS for server1 server1 with Timeout 300 Max recs per read 1

CDC API 'cdc_opensess' Failed at cdcapi_INFORMIX.ec:1277. CDCAPI_RETVAL = -83702, CDC_ERRORCODE = CDC_E_APIVERS CDC Error Description is The requested CDC API behavior version is not valid or is unsupported.

Total buffers read: 0 Total records extracted: 0 Average recs per buffer: 0.000000


Sree
  • 337
  • 4
  • 10
  • 1
    Note that you should have `$INFORMIXDIR/demo/cdc/cdcapi.ec` on your machine which should contain the code that was delivered with your software, and which should, therefore, work with your software. The compilation warnings are not very satisfactory. Fixing them is harder than it looks. The function `lddecimal()` is declared in `$INFORMIXDIR/incl/public/decimal.h` but not in `$INFORMIXDIR/incl/esql/decimal.h` for reasons which elude me. Similarly, the function `ifxcdc_valisnull()` is `$INFORMIXDIR/incl/public/sqlhdr.h`, but not `$INFORMIXDIR/incl/esql/sqlhdr.h`. That doesn't even show for you. – Jonathan Leffler Mar 11 '17 at 00:52
  • thank you Jonathan – Sree Mar 12 '17 at 22:45

1 Answers1

3

The CDC error -83702 refers to a mismatch in the API version. Since your version of ESQL/C is 3.50.FC5 I presume your Informix server version is 11.50.FC5. This uses an earlier version (1.0) of the CDC API whilst the example code from the IBM Knowledge Center uses API version 1.1.

This problem can be resolved by upgrading the Informix server to 11.50.FC6 or later. The latest 11.50 version is 11.50.FC9W3.

Simon Riddle
  • 976
  • 4
  • 4