Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    India
    Posts
    1

    Question Unanswered: DB2 VARGRAPHIC problem?

    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.

  2. #2
    Join Date
    Mar 2003
    Posts
    1

    Post Re: DB2 VARGRAPHIC problem?

    Hi, Suresh

    I have the same problem, did u find the solution for this? If yes, please let me know asap because I am working in a project, the time period to finish that project is very less. Can you please let me know how u solved the problem?

    Thanks
    Prakash



    Originally posted by suresh_cm
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •