Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data mapping problems ?

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am having a problem updating a file on our AS/400. I am connecting to our AS/400 via JDBC (V3R2 400). My problem is, in my application, I have numerous fields that the user can enter information into. The user is not required to enter info into every field( ie.. not every vendor has a minimum order amount). Right now, I am taking the value of whatever is in the fields and updating the 400 with that info. However, if the user does not key something into a field (like minimum order amount) then I get an error message "SQL0407 - Null value is not allowed for field PCVMIN in table PCVEND".
I want the user to not have to key information into this field, and be able to update the 400 without getting this error message!
What do I need to do? (Min order is a numeric field).
Any help is greatly appreciated. (I am using VA for Java 3.5.3 if that makes any difference).
Thanks in advance!

 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you set a default value, or allow null in the database field? It sounds like you are violating a database constraint of "NOT NULL"
Jamie
 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. If I set the database field to ALWNULL...
I get an error message when trying to run an update program on the AS/400 that tells me a data mapping error has occurred, and an unexpected null value was found.
( I had to write a program to output zeros into numeric fields that had blanks in some of our old records).
Any other suggestions?
 
Fred Abbot
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make a default value for the fields
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic