Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Exclamation Unanswered: Error when inserting record - SQLSTATE 42704

    hi ,

    I've a WebSphere server and connect to DB2 using passw.

    DOC table structure:

    CREATE TABLE DB1.DOC
    (DOC_ID BIGINT NOT NULL )
    DATA CAPTURE NONE
    IN USERSPACE1;

    ALTER TABLE DB1.DOC
    LOCKSIZE ROW
    APPEND OFF
    NOT VOLATILE;

    ALTER TABLE DB1.DOC
    ADD CONSTRAINT PK_DOC PRIMARY KEY
    (DOC_ID);


    in java code i call insert into DB1.DOC(doc_template_id) values (23);

    Here is an exception message:

    Exception data: javax.ejb.EJBException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: DB1.DOC


    and as i know => SQLSTATE 42704: An undefined object or constraint name was detected.


    Help needed, thx!
    Last edited by talex; 07-18-08 at 20:26.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    According to your DDL, the column name is DOC_ID. In your insert statement, you called it doc_template_id.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jul 2008
    Posts
    5
    Quote Originally Posted by Marcus_A
    According to your DDL, the column name is DOC_ID. In your insert statement, you called it doc_template_id.
    Thx for help. The problem was in code, more in Eclipse IDE, it was needed to stop, clean than build and only after start server to apply changes.
    Nothing with DB issues.

Posting Permissions

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