So I was workiing with a customer today and got an interesting question. The question was how did
sqlca.sqerrd work with cursors, specifically would it track all the inserts in a the entirely of the cursor.
The answer turns out to be yes, but with a a couple of caveats. The first is you need to check the value sqlerrd before you close the cursor.
The second is that if your cursor returns more rows than will fit in the fetch array (either using the default array size, or a custom value specified for FetArrSize), then you should check the value of sqlca.sqlerrd prior to the next FETCH operation, as this will show the value for the number of rows in the current fetch array. The value will then reset with the next FETCH. See item #5 in the following URL: http://publib.boulder.ibm.com/infocenter/idshelp/v115/index.jsp?topic=%2Fcom.ibm.esqlc.doc%2Fsii15750078.htm
Of course your next question may be , "FetArrSize? What is that?"
It's a new, circa ESQL/C 3.10, global variable. FetArrSize, indicates the number of rows to be returned per FETCH statement. This variable is defined as a C language short integer data type. It has a default value of zero, which disables the fetch array feature. You can set FetArrSize to any integer value in the following range:
More info can be found at