On Fri, 18 Oct 2002, Gavin Sinclair wrote:

> From: "Gavin Sinclair" <gsinclair / soyabean.com.au>
>
> > From: "Philipp Meier" <meier / meisterbohne.de>
> >
> >
> > > For now, I am resorting to storing my date information as strings in the
> > > database.  Does anyone know about the logistics of database-independent
> date
> > > handling?
> >
> > I use DBI with Mysql and prepared statements:
> >
> > stm = dbh.prepare("intert into test values (?)")
> > stm.execute(Time.now)
> >
> > -billy.
>
> I tried that code and got the following error:
>
> ../site_ruby/1.6/DBD/Oracle/Oracle.rb:290:in `execute': ORA-01861: literal
> does not match format string (DBI::DatabaseError)
>
> I guess the driver's just not built for it :(

silly question, but have you tried quoting the date string?

stm = dbh.prepare("insert into test values ('?')")


i have not used the dbi, or oracle, but i need the quote the output of
Time.now when i use it in postgresql - so i thought i'd throw that out
there...

-a

-- 

 ====================================
 | Ara Howard
 | NOAA Forecast Systems Laboratory
 | Information and Technology Services
 | Data Systems Group
 | R/FST 325 Broadway
 | Boulder, CO 80305-3328
 | Email: ahoward / fsl.noaa.gov
 | Phone:  303-497-7238
 | Fax:    303-497-7259
 ====================================