Skip to Content.
Sympa Menu

freetds - Re: [freetds] SOT: DBI::ODBC datetime format for update

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Roderick A. Anderson" <raanders AT tsmg.us>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] SOT: DBI::ODBC datetime format for update
  • Date: Wed, 15 Sep 2004 11:34:37 -0700

Geez I hate to reply to my own message. Especially when I figure out
the answer a few minutes after sending it.

So beating my way through the MS SQL Server docs I found that the
_default_ datetime format is "YYYY-MM-DD HH:MM:SS.sss".

Sorry to waste the bandwidth.


Rod
--
Roderick A. Anderson
Project Manager
Technology Services Management Group
<http://www.technologyservicesmanagementgroup.com/>
Spokane WA, 99202



Roderick A. Anderson wrote:
> Sorry for the off topic post but my web searches have not produced an
> answer. In fact I'm not necessarily looking for an answer but a pointer
> (or a whack from a clue-stick) to where to look or the correct terms to
> use for my search. I have tried all the obvious terms in various
> collections and combinations and only found information on how to change
> the output of datetime fields.
>
> I'm getting a failure message using DBI::ODBC on a Win2k server
> accessing a SQL Server database (different system) via a system dsn. I
> can't figure out what format to use for a datetime field. I've not had
> a problem doing similar operation using Win32::ODBC with a smalldatetime
> field. But when using DBI::ODBC and updating a datatime field I get
> errors like this:
>
> DBI Error:DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server
> Driver] Invalid character value for cast specification (SQL-22018)(DBD:
> st_execute/SQLExecute err=-1) at script.pl line 77.
>
> The variable used is set to '09/15/04' but even attempts using '20040915
> 05:05:05' and variations fail.
>
> This goes away when I remove the code to update the datetime field.
>
> So where should I go or what should I search for?
>
>
> TIA,
> Rod
---
[This E-mail scanned for viruses by Declude Virus]





Archive powered by MHonArc 2.6.24.

Top of Page