• 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

Data mapping problems ?

 
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
make a default value for the fields
reply
    Bookmark Topic Watch Topic
  • New Topic