[OT] Oracle flame (was: Re: [Zope] Field type 'Date' in SQL r equest)

Smith, Neil Neil.Smith@npower.com
Wed, 6 Feb 2002 08:49:39 -0000


You are using the wrong quote characters.  In Oracle, double quotes are used
to define a case sensitive column name, so it is looking for a column called
08/08/1997 not the string.  Use single quotes and it will work.

However there are numerous other problems with your SQL.  I suspect you
really want:

select DATE_NAI_IND, COD_ETU 
from VUE_TRAV_EXT_RVM_RES
where TRUNC(DATE_NAI_IND)= TO_DATE('08/08/1997', 'dd/mm/yyyy')

Neil Smith

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: 05 February 2002 22:01
To: champier2002
Cc: Zope@zope.org
Subject: [OT] Oracle flame (was: Re: [Zope] Field type 'Date' in SQL
request)


champier2002 writes:
 > The application has a link with an Oracle database.
 > In the SQL table the field is defined like this :
 >  DATE_NAI_IND  DATE  with NULL
 > 
 > When I try to use this field in a SQL request, for example : 
 > select DATE_NAI_IND, COD_ETU from VUE_TRAV_EXT_RVM_RES
 > where
 >  TO_CHAR(DATE_NAI_IND,'dd/mm/yy')= "08/08/1997"
 >  or
 >  DATE_NAI_IND = "08/08/1997"
 > 
 > I always receive the same error : 
 > Error, dco2.DatabaseError: (904, 'ORA-00904: Nom de colonne non 
 > valide')
I like Oracle error messages: they always hide the essential information...


Dieter

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )
**********************************************************************
 
The information contained in this e-mail is confidential and intended only
for the use of the addressee. If the reader of this message is not the
addressee, you are hereby notified that you have received this e-mail in
error and you must not copy, disseminate, distribute, use or take any action
as a result of the information contained in it.
    
If you have received this e-mail in error, please notify
postmaster@npower.com (UK 01384 275454) and delete it immediately from your
system.
    
**********************************************************************
**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster@npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.

Npower Limited
Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277

This e-mail may be sent on behalf of a member of the Innogy plc group of companies.

**********************************************************************