SQL error

895 pts.
Tags:
DB2/400
IBM DB2
SQL error messages
SQLRPGLE
I've a cursor to fetch date from DB2/400...When date is stored as

0001-01-01, I get error - Year portion of the Date not in correct range. This is the default date my update program stores when user doesnt enter anything for date field. How can I bypass this error while fetching SQL cursor in my SQL RPGLE program?

Thanks,

NG



Software/Hardware used:
AS400 - SQLRPGLE

Answer Wiki

Thanks. We'll let you know when a new response is added.

Is this an SQL error that you get or an error generated by your programs?
Phil
==========================================================================
You could use DSPATR(ND) to “hide” the value when you don’t want it displayed.

Phil
=========================================================================

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Nutangujar
    well...just realized that the error is generated by program when i try to execute *mdy move date1 date2 my screen field for date is of data type 'date' i want to display blanks when the date is 01/01/0001 can i achieve this without changing the screen field type?
    895 pointsBadges:
    report
  • graybeard52
    You have a couple of choices. One is to test the date1 field for D'0001-01-01" and seton an indicator to make the field non-dosplay when this happens. Another option is to define the screen field as a char or numeric field. Then you could yo something like this. If date1 = *loval eval date 2= *blanks else eval date2 = %char(date1:*mdy) endif
    3,115 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following