Hi,
I am developing an internationalized Java application which uses DB2 UDB version 7.2 unicode database. The database is created using codeset UTF-8 and JDBC 2.0 is used to connect the application to the database. I've the following table:
CREATE REGULAR TABLESPACE TsStmtDefn
MANAGED BY DATABASE
USING (FILE 'd:\bgsampledb2\TsStmtDefn' 257)
EXTENTSIZE 16 PREFETCHSIZE 2 ;
CREATE LONG TABLESPACE TsStmtDefnBlob
MANAGED BY DATABASE
USING (FILE 'd:\bgsampledb2\TsStmtDefnBlob' 513)
EXTENTSIZE 48 PREFETCHSIZE 4 ;
CREATE TABLE bgadmin.definition
(
id CHAR(8) FOR BIT DATA NOT NULL,
name VARGRAPHIC(50) NOT NULL,
definitionblob BLOB(500K) COMPACT
)
IN TsStmtDefn
LONG IN TsStmtDefnBlob;
CREATE UNIQUE INDEX ix1_definition
ON bgadmin.definition (
id ASC
);
CREATE UNIQUE INDEX ix2_definition
ON bgadmin.definition (
name ASC
);
ALTER TABLE bgadmin.definition
ADD CONSTRAINT p_definition PRIMARY KEY (id);
As clear from the script, I am using a VARGRAPHIC field to hold unicode graphic character data. Now the problem is that when I try to insert or update a record into the table, I am getting the following error:
SQL USED:
---------
INSERT INTO DEFINITION ( ID, NAME, DEFINITIONBLOB ) VALUES ( ?, ?, ? )
>>>input values: [[B@7e83bb1a][iBillerDef][[B@4b567b1b]
ERROR:
------
[IBM][CLI Driver][DB2/6000] SQL0301N The value of a host variable in the EXECUTE or OPEN statement cannot be used because of its data type. SQLSTATE=07006
>>>executed with error: [IBM][CLI Driver][DB2/6000] SQL0301N The value of a host variable in the EXECUTE or OPEN statement cannot be used because of its data type. SQLSTATE=07006
The error does not occur if I use a VARCHAR field instead of VARGRAPHIC field. Also, the insert/update operation entry is working fine without a BLOB field. It looks like there is a problem with an insert/update operation in DB2 unicode databse when a VARGRAPHIC and BLOB fields occur together in a table. Can somebody help me in figuring out a solution for this ?
Best regards,
Suresh.