[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Insert Error- Date Problem
- Subject: Re: Insert Error- Date Problem
- From: Peter Clark <PGCLARK@VAC-ACC.GC.CA>
- Date: Thu, 28 Feb 2002 12:26:39 -0400
The date coming from your flatfile is in string format, not date format,
therefore you need to use strtodate, not datetostr. And the mask will be the
format of your incoming string date i.e. 'YYYYMMDD'
>>> Jason Rupp <jrupp@TECHNEGLAS.COM> 2002/02/28 11:37:05 am >>>
Hello All!
DATABASE = Oracle 8
I wrote a simple sqr that reads a flat file and inserts into a
PeopleSoft table (PERSONAL_DATA). The flat file only has about 12
fields so I am inserting default values or spaces for the other 100+
fields in the table. The program is reading the file perfectly but when
it goes to insert, I get an error:
(SQR 5528) ORACLE OCIStmtExecute error 1847 in cursor 5:
ORA-01847: day of month must be between 1 and last day of month
Error on line 203:
(SQR 3735) Could not execute SQL.
There are about 10 date fields on this record but I am only inserting
values for 2 of them. For the other 8 date fields, I tried inserting
NULL, '', and ' ' and had no luck.
When I read the date off the flat file, the string looks like this:
19700101
I then do a datetostr using the mask of 'DD-MON-YYY' so the value being
inserted is '01-JAN-1970'. I don't think this is the problem though.
Does anyone have any ideas? I appreciate your time.
Thanks,
Jason