I've spent too much time on this problem and need some help. I have to be
missing something obvious here.
Using embedded SQL in an RPGLE program I am getting an SQL0180 error (Syntax
of date, time, or timestamp value not valid) on the following insert
command...
exec sql
insert into TESTFILE Values(:TESTFILEDs :TESTNullInd);
The TESTFILEds is externally described (as follows)
d TESTFILEDS e ds extname(TESTFILE)
The TestNullInd is an array of null indicators for each field in TESTFILE.
The file is defined in DDS and the date data type fields have DATFMT(*ISO)
and ALWNULL attributes.
The data structure fields in the TESTFILEDS are all populated correctly
before the sql insert command. Specifically, the date fields have
'2012-07-09' [using DateField = %date(); ]. When the SQL statement is
executed, the SQL0180 appears and no records is inserted. However, I can
use DFU and interactive SQL to enter the record manually, using the same
field values, and it works fine. It makes no difference what the null
indicator values are set to (null or not null) in the RPG, the error still
occurs. I have the program in debug and have tried changing the date field
contents to every date format I can think of and it makes no difference. I
still get the error.
I am on a v7r1 system. Is there a PTF I haven't found out about? or am I
just boneheaded about something here? I am about to resort to native file
access here but really need to stay with embedded SQL.
Thanks for any advice.
Tom Garvey
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.