Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Semi Y2K problem: Trouble calling procedures with DATE parameters

Semi Y2K problem: Trouble calling procedures with DATE parameters

From: <smcgerty_at_my-deja.com>
Date: Mon, 11 Oct 1999 01:11:21 GMT
Message-ID: <7trdfj$t50$1@nnrp1.deja.com>

I am having trouble passing dates to oracle procedures using ADO (which I understand uses ODBC underneath). While I can pass two digit year dates as strings of the form 'DD-MMM-YY':

{call addtest ('John', '20-DEC-99')}

I can't seem to pass dates with four digit years 'DD-MMM-YYYY':

{call addtest ('John', '20-DEC-2010')}

which results in an Oracle OCI error "ORA-01830: date format picture ends before converting entire input string".

I checked the documentation, and it seems I must use to_date(), so I tried the following:

{call addtest ('John', to_date ('20-FEB-2010', 'DD-MON-YYYY'))}

Unfortunately, this gives an ODBC Oracle Driver "Syntax Error".

However, if I use to_date() in a straight insert statement:

 insert in DATETEST values ('John',

                            to_date ('20-FEB-2010', 'DD-MON-YYYY'))

it works fine.

What am I doing wrong with the procedure call?

In case it's of interest, the procedure is defined as:

 PROCEDURE ADDTEST (name varchar2, finishdate date) IS  BEGIN
  insert into DATETEST values (name, finishdate);  END; DATETEST has two columns, name (VARCHAR2) and finishdate (DATE)

Any help appreciated,
Stephen.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sun Oct 10 1999 - 20:11:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US