dbTalk Databases Forums  

Re: TO_DATE

comp.databases.rdb comp.databases.rdb


Discuss Re: TO_DATE in the comp.databases.rdb forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Manfred Peter
 
Posts: n/a

Default Re: TO_DATE - 04-09-2004 , 06:51 AM






Jay Northrop wrote:

Quote:
This one might be a simple one for you, but I searched the archives
and couldn't find anything that would help.

I am having a problem running queries against an Oracle RDB database
using JDBC (sorry, I don't know the version of RDB) that use the
TO_DATE function.

The queries is a very simple one:

select dob from inmate where DOB IN TO_DATE('06/19/1967',
'MM/DD/YYYY')

The error is:

%SQL-F-TRUNCPARAM1, Routine TO_DATE expects 3 Parameters

Now, I am familiar with running Oracle SQL queries, but I'm not
terribly familiar with a 3rd parameter. I've done some looking around
and found that it is an NLS environment variable of some sort, but I'm
not sure what it should be. Any help would be appreciated.

Jay Northrop


Hello,

This statements is ok. But perhaps ths parser gets problems with the TRUNC
Just some suggestion:

1) SELECT dob FROM inmate WHERE TRUNC(dob) IN
(TRUNC(TO_DATE('06/19/1967', 'MM/DD/YYYY')))

or

2) SELECT dob FROM inmate WHERE TRUNC(dob) = TRUNC((TO_DATE('06/19/1967
00:00:00', 'MM/DD/YYYY HH:MI:SS'))))

Hope this helps ?

Best regards
Manfred Peter
Alligator Company Software GmbH
http://www.alligatorsql.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.