Re: Datetime overflow with DBI ODBC setting 19th century dates with placeholders
From: Brian McCauley (nobull_at_mail.com)
Date: 05/14/04
- Next message: Tad McClellan: "Re: Perldoc versus Man"
- Previous message: Brian McCauley: "Re: Stopping code execution in RE's"
- In reply to: iain: "Datetime overflow with DBI ODBC setting 19th century dates with placeholders"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 May 2004 13:13:50 +0100
"iain" <irhm@clara.net> writes:
> I'm trying to update 19th century dates in SQL Server.
>
> It works fine with dates on or after 1 Jan 1900, but not before. It is also
> OK if the 19th century dates are included as literals in the SQL INSERT or
> UPDATE command (with $dbh->do or prepare/execute)
>
> Error message: DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server
> Driver]Datetime field overflow (SQL-22008)(DBD: st_execute/SQLExecute
> err=-1) at Pat_DOB_error_report.pl line 13.
I've hit this problem too.
> I've tried all kinds of options like bind_param, SQL_DATE, CAST(? as
> datetime). It seems to be interpreted as a date, but the actual year is not
> being processed correctly.
>
> I'm not sure if this is a SQL Server or DBD::ODBC issue. I am using recent
> versions of everything.
I'm not sure either. It could also be in ODBC itself or in the ODBC
driver for MSSQL.
It seems that somewhere along the line all datetime placeholders are
treated as short. One day I'm going to have to investigate.
> Any ideas for correction or workaround?
Other than not using placeholders, no.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
- Next message: Tad McClellan: "Re: Perldoc versus Man"
- Previous message: Brian McCauley: "Re: Stopping code execution in RE's"
- In reply to: iain: "Datetime overflow with DBI ODBC setting 19th century dates with placeholders"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|