The Artima Developer Community
Sponsored Link

Java Answers Forum
duplicate column name

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Volodymyr Shram

Posts: 1
Nickname: scar
Registered: Aug, 2002

duplicate column name Posted: Aug 6, 2002 4:22 AM
Reply to this message Reply
Advertisement
Hello,

I am calling one create() method in my entity bean. I have correct values for all fields (one int for the primary key and the rest are integer also). When I try to run it I get a strange error which I will paste in at the bottom (duplicate column name).

17:05:44,030 ERROR [OsdProofsWeekReplace] Could not create entity
java.sql.SQLException: ORA-00957: duplicate column name

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822
)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.ja
va:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.jav
a:1371)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1 900)
.......... and so on.....

When I have been removed relationships with another entity beans in my cantainer, create() method works correctly -- insert new string into my table. I have many such entity beans and I got one thing -- I may call create() method succesfully when current bean HAS NOT relationships FROM another beans...

I have not a relationship where the foreign keys are part of the primary keys in my case. I have simple integer primary and integer foreign key only.
When I have been turned on debug, I got next error message in jboss application server console:

2002-08-06 09:58:39,167 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.PmInfoVacations] Create: pk=61
2002-08-06 09:58:39,167 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.PmInfoVacations] Executing SQL: SELECT COUNT(*) FROM
PM_INFO_VACATIONS WHERE INFO_VACATION_ID=?
2002-08-06 09:58:39,628 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.PmInfoVacations] Executing SQL: INSERT INTO
PM_INFO_VACATIONS (INFO_VACATION_ID, CLOCK_NUMBER, LEAVE_DAYS, START_DATE, END_DATE, DECREE_NUMBER, DECREE_DATE, NOTES, LEAVE_KIND_ID,
CLOCK_NUMBER) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
2002-08-06 09:58:39,888 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.PmInfoVacations] Could not create entity
java.sql.SQLException: ORA-00957: duplicate column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)

Insert statement here is incorrect -- INFO_VACATION_ID is primary key in this table (Integer), first CLOCK_NUMBER - foreign key from another table, LEAVE_KIND_ID - foreign key to another table (it is unimportant in this case) and other fields -- just data. But what is second CLOCK_NUMBER field in this INSERT statement? First CLOCK_NUMBER - real field in the table, but second... Does anybody has any idea?
Is there any way to solve my problem?

If anyone can help it would be greatly appreciated.

Topic: help with deleting a node in a linked list Previous Topic   Next Topic Topic: printing JPanel that is added to the JScrollPane

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use