Topic
  • 1 reply
  • Latest Post - ‏2012-07-11T15:22:10Z by rosmarcha
rosmarcha
rosmarcha
2 Posts

Pinned topic error binding with blob in c++

‏2012-07-10T18:11:38Z |
hi,

i have an issue when binding c++ a sqx file after upgrading our db2 client.

new product.
DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL09074" with
level identifier "08050107".
Informational tokens are "DB2 v9.7.400.501", "s110330", "IP23237", and Fix Pack "4".
Product is installed at "C:\SQLLIB" with DB2 Copy Name "DB2COPY1".

here is the situation,

in a method i declare

EXEC SQL BEGIN DECLARE SECTION;
long s_lBlobSize;
long s_lFromPos;
SQL TYPE IS BLOB (2M) s_blobMem;
EXEC SQL END DECLARE SECTION;

when binding i get this error
--> The host variable "s_blobMem" is incorrectly declared. the generated code looks like this. Notice the size zero for the array

/*SQL TYPE IS BLOB (2M)*/
struct s_blobMem_t {
sqluint32 length;
char data[0];
} s_blobMem;
if i modified the code and add another SQL Type

EXEC SQL BEGIN DECLARE SECTION;
long s_lBlobSize;
long s_lFromPos;
SQL TYPE IS BLOB (2M) blob; ////// new line
SQL TYPE IS BLOB (2M) s_blobMem;
EXEC SQL END DECLARE SECTION;

the generated c++ code is fine for s_blobMem but an error for blob
--> The host variable "blob" is incorrectly declared.

and now the generated code looks like this

#line 3266 "DMEmbSql.sqx"
/*SQL TYPE IS BLOB (40K)*/
struct clr_t {
sqluint32 length;
char data[0];
} clr;
/*
SQL0314N The host variable "clr" is incorrectly declared.
*/

#line 3266 "DMEmbSql.sqx"

#line 3267 "DMEmbSql.sqx"
/*SQL TYPE IS BLOB (2M)*/
struct s_blobMem_t {
sqluint32 length;
char data2097152;
} s_blobMem;

is this a know problem with 9.7.4? should i upgrade to 9.7.6 (packfix)

by the way this was working fine with an earlier release of db2 client.

regards
Charles.
Updated on 2012-07-11T15:22:10Z at 2012-07-11T15:22:10Z by rosmarcha
  • rosmarcha
    rosmarcha
    2 Posts

    Re: error binding with blob in c++

    ‏2012-07-11T15:22:10Z  
    yep, upgraded to 9.7.6 and everything is back to normal.

    charles.