0

I'm using JPA with EclipseLink provider in my application to connect to an AS400. I have one entity WebRequest which has a @OneToOne relationship to my RateQuote entity. A WebRequest life cycle starts off with it's RateQuote property being null until the user processes the WebRequest and generates a RateQuote. What I'm trying to achieve is rather than insert null, insert 0 since the underlying field is DECIMAL(7,0) in the WebRequest table.

On our AS400 (V6R1), we have the WRKDBF utility for viewing the data. When I persist a null value to the table, WRKDBF crashes when trying to view the data.

Any help is appreciated.

Thanks.

3
  • 3
    File a bug to WRKDBF instead of polluting your database with incorrect values?
    – JB Nizet
    Apr 10, 2013 at 14:31
  • 0 isn't an incorrect value in a DECIMAL(7,0) field. Apr 10, 2013 at 14:49
  • 2
    0 is a not a correct way to store a null foreign key in a relational database. null is the correct value. If WRKDBF is so crappy that it crashes when a nullable database column contains null, then yo should file a bug, or use another tool, instead of polluting your database, making foreign key constraints impossible, and using standard APIs like JPA impossible.
    – JB Nizet
    Apr 10, 2013 at 14:57

3 Answers 3

1

I have had issues with the WRKDBF utility generating CPF5035/RNX1299 when accessing 'SQL' files.

Take a look at the freeware program PEEK/400 for a replacement.

0

You could make a dummy RateQuote object with an Id of 0, and assign it instead of null, but this is a kind of hack. Fixing the utility would be best.

0

There is an alternative to WRKDBF It's on my website. Has some differences, principal one to work only with SQL on physical as well as on logical files with any SQL selection. Supports Date fields and Null fields. Free to try. see WRKDBF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.