If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Problem when insert data - SQLSTATE 42704

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-08, 18:59
talex talex is offline
Registered User
 
Join Date: Jul 2008
Posts: 5
Exclamation 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 19:26.
Reply With Quote
  #2 (permalink)  
Old 07-18-08, 19:52
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 07-21-08, 12:30
talex talex is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On