hi [message #373341] |
Wed, 11 April 2001 19:20 |
gangadhar gundavaram
Messages: 9 Registered: April 2001
|
Junior Member |
|
|
Hi,
Iam getting problem while retrieving from database
SELECT USERID,FIRSTNAME,LASTNAME,REGDATE FROM OLT_STUDENT WHERE REGDATE BETWEEN '1-JAN-01' AND '1-JAN-01'
11/Apr/2001:17:00:05 info (23785): ORA-01858: a non-numeric character was found where a numeric was expected.
could tell me why.
Thanks in Advance
-RAO
|
|
|
Re: hi [message #373343 is a reply to message #373341] |
Wed, 11 April 2001 19:47 |
Naresh Sharma
Messages: 12 Registered: April 2001
|
Junior Member |
|
|
Hi,
This is a Date Function Error message.
The input data to be converted using a date format model was incorrect. The format model expected a number but found a non-numeric character.
Check the input data and the date format model to make sure the elements match in number and type, then retry the operation.
-----------------------
Also it would be helpful if could post the
table structure or send it accross to me
on : nashcomp@yahoo.com
------------------------
HTH
Naresh
|
|
|
Re: hi [message #373363 is a reply to message #373341] |
Thu, 12 April 2001 12:02 |
Andrew again...
Messages: 270 Registered: July 2000
|
Senior Member |
|
|
I suspect that REGDATE is of datatype DATE. If so, Oracle implicitly needs to convert either the Date to a string to compare with your input value or convert your strings to dates (using the default picture format). Oracle never used to specify which way the conversion would occur, but maybe does now. The default format is 'DD-MON-YY', but may be different in your environment.
Try this...
SELECT USERID,FIRSTNAME,LASTNAME,REGDATE FROM OLT_STUDENT WHERE REGDATE BETWEEN to_date('1-JAN-01', 'DD-MON-YY')...
be sure to include the format picture to keep your code robust
It would be better to specify YYYY than YY or RR
select to_char(to_date('01-JAN-81', 'DD-MON-YY'), 'DD-Mon-yyyy') from dual;
01-Jan-2081
select to_char(to_date('01-JAN-81', 'DD-MON-RR'), 'DD-Mon-yyyy') from dual;
01-Jan-1981
|
|
|
Re: hi [message #373364 is a reply to message #373363] |
Thu, 12 April 2001 12:47 |
Gangadhar
Messages: 3 Registered: April 2001
|
Junior Member |
|
|
Hi Andrew,
Thanks very much. yeah it is working fine.
thanks for your detail explanation.
-RAO
|
|
|