This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Foreign-key Problems in DBUnit Test Data  RSS feed

Vineela Jyothi
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dataset xml (input.xml) file for a table "Trade".
Trade table has a column "desc_id" which is foreign key for table "Desciption" column "id".
In both the tables, the id is auto-increment by the Database.

If i dont specify any value for "desc_id" in the below input.xml, i get an error "desc_id could not be null..."
If i specify any random value, i get the error "com.sybase.jdbc3.jdbc.SybSQLException: Foreign key constraint violation occurred..."

Please suggest me how to deal with this.

Here is my input.xml:
<?xml version='1.0' encoding='UTF-8'?>
<trade version="1" is_latest="true" status="DONE"
user_information="XXXXXX500005" upstream="ABC"
format="REAL" create_datetime="2012-06-20 00:00:25" />
<trade version="1" is_latest="true" status="DONE"
user_information="YYYYY500005" upstream="HKK"
format="FPB" create_datetime="2012-06-20 00:00:25" />
<trade version="1" is_latest="true" status="SENT"
user_information="ZZZZ500005" upstream="SCC"
format="REAL" create_datetime="2012-06-20 00:00:25" />
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!