Problem with Date format in oracOCI
Moderators: chulett, rschirm, roy
Problem with Date format in oracOCI
I have a simple job it extracts data from a flat file and loads into a oracle table.I have 3 date fields coming from source file which are of datatype varchar and length 10 and it is coming in the format mm/dd/yyyy.I am converting them in the transformer using
ICONV(Date,"D/MDY[2,2,4]") and inserting into oracle table ABCD,the corresponding data type for these fields is Date in my oraOCI.The job is running fine,it is inserting rows into table ABCD.
But when i try to click view data in the oraOCI stage i am getting below error
ocixyz: ORA-01821: date format not recognized
ocixyz.DSLink1: DSP.Open GCI $DSP.Open error -100.
when i view the data in TOAD against table ABCD i can see the data.
can anyone let me know what might be the problem.
Thanks
sheema
ICONV(Date,"D/MDY[2,2,4]") and inserting into oracle table ABCD,the corresponding data type for these fields is Date in my oraOCI.The job is running fine,it is inserting rows into table ABCD.
But when i try to click view data in the oraOCI stage i am getting below error
ocixyz: ORA-01821: date format not recognized
ocixyz.DSLink1: DSP.Open GCI $DSP.Open error -100.
when i view the data in TOAD against table ABCD i can see the data.
can anyone let me know what might be the problem.
Thanks
sheema
Change the data type from date to Timestamp and check if you get the same problem.
I still doubt all the data got loaded into your target table from your previous run, check if everythinig got loaded.
I still doubt all the data got loaded into your target table from your previous run, check if everythinig got loaded.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
DB2 does. I dont think oracle does and hence my original question and doubt.
Try sending in your data as
Try sending in your data as
Code: Select all
OCONV(ICONV(Date,"D/MDY[2,2,4]"),"D-YMD[4,2,2]")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Means nothing. Toad uses specific date masks for display, set in the options - can be anything you want.sheema wrote:yes,that is the data which i am inserting.the date appears in mm/dd/yyyy format in TOAD.
Nope. I'm getting tired of explaining this over and over, guess that FAQ on the subject is long overdue.sheema also wrote:I knew that DB2 accepts internal date format,so i was not sure that Oracle also accepts the internal date format.
All that matters is the format coming in your Sequential file. After that it's all 'standard' transforms to get it into a format the OCI stage will love:
YYYY-MM-DD HH24:MI:SS
Set your target datatype to Timestamp, use generated SQL, get the date into the output format shown above and append a zero timestamp to the end of the date. Oracle will love you for it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
chulett,
I have used the format OCONV(ICONV(Date,"D/MDY[2,2,4]"),"D-YMD[4,2,2]"):"00:00:00" in my transformer and changed the datatype to Timestamp(19) and loaded into the table.
The data is getting loaded into the table.
But when i select the view data option i am getting the same error as i posted .
I have used the format OCONV(ICONV(Date,"D/MDY[2,2,4]"),"D-YMD[4,2,2]"):"00:00:00" in my transformer and changed the datatype to Timestamp(19) and loaded into the table.
The data is getting loaded into the table.
But when i select the view data option i am getting the same error as i posted .
Last edited by sheema on Fri Jan 26, 2007 11:51 am, edited 1 time in total.
You forgot a space before the time part.
I am just amazed as to how your data gets loaded with messed up data format and no warning shows up.
Code: Select all
OCONV(ICONV(Date,"D/MDY[2,2,4]"),"D-YMD[4,2,2]"):" 00:00:00"
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.