Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> OCI (how to insert a date)
Hi!
I need help on how to pass a string value to a date column using OCI. For testing purposes I have created a simple table ("AKADATE") which only has one column of type DATE.
I now want to insert a row. This is what I do:
Prepare a statement.
INSERT into AKADATE values (TO_DATE(:1))
Bind the statement by position.
position - 1 (first column)
valuep - pointer to a null-terminated string.
value_sz - 64 (should be big enough)
dty - SQLT_STR
Execute tne statement
"Feb-11-2001,MON-DD-YYYY" (no single quotation marks)
"Feb-11-2001 , MON-DD-YYYY" (space between comma)
"Feb-11-2001 ,'MON-DD-YYYY'" (only single quotation marks for the format)
...
but nothing seems to work! In all cases I get this error:
ORA-01858: a non-numeric character was found where a numeric was expected
I am sure it is something simple but since this is my first venture into OCI I am stumped!
Any help will be greatly appreciated!!
Thanks!
-Ajay Agrawal
ajay_at_themoment.com Received on Fri Mar 23 2001 - 17:51:40 CST
![]() |
![]() |