[Zope] oracle date-type

Jim Sanford jsanford@atinucleus.com
Sat, 20 Nov 1999 10:01:36 -0600


I don't use Oracle but VisualFoxpro tables via ODBC. I use a CTOD (Character
TO Date) or CTOT (Character TO Time) function on a string (since a string is
what is returned by a get or a post) . You should be able to do something
similar in Oracle.

Example:

update some_table set some_date=CTOD(<dtml-sqlvar a_date type=string>) where
recid=<dtml-sqlvar rec_id type=int>

(I use a javascript date validating function in the onChange of input fields
in the browser code to insure that I am getting a valid date string in the
REQUEST.)

other example:
         CTOT(<dtml-sqlvar "(ZopeTime()-.25).strftime('%m/%d/%Y
%I:%M:%S%p')" type=string>)
         (the -.25 gives me local time from Zulu time returned by ZOpeTime)

In my experience Zope returns a DateTime type for date or datetime fields
when returning variables from a select statement

 __________________________________________________________________

              Jim Sanford
      .       Database Engineer
     / \  /   Accelerated Technology, Inc.
    /   /     720 Oak Circle Drive East
   /  /  \    Mobile, AL 36609
  / /     \   Voice: 334-661-5770  fax: 334-661-5788
 /         \  E-Mail: jsanford@atinucleus.com
              Web: http://www.atinucleus.com

 Source Code, No Royalties, Any CPU...It just make sense !
 __________________________________________________________________

----- Original Message -----
From: Martin Hofer <hofer@oeh.tu-graz.ac.at>
To: <zope@zope.org>
Sent: Saturday, November 20, 1999 6:13 AM
Subject: [Zope] oracle date-type


> hi out there
>
> does someone know, how to query oracle-date fields using dcoracle??
> the sqlvar and sqltest-commands don't support type=date!!!
>
> thanks in advance
>
> mARTin hofer
>
> ---------------------------------------
> o  Fa. Intakt Telekommunikation GmbH  o
> ---------------------------------------
>
>  Färberberg 69
>  8330 Feldbach - Austria
>
>  mail: hofer@intakt.at           o
>  tel: +43/03152 3030-0
>  fax: +43/03152 3030-4           | ---
>  mobil: +43/0699-1016 1847       | |  |
>  internet: www.intakt.at         | |  |
> ---------------------------------------
>
>
> _______________________________________________
> 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 )
>
>