• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Foreign-key Problems in DBUnit Test Data

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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'?>
<dataset>
<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" />
</dataset>
 
reply
    Bookmark Topic Watch Topic
  • New Topic