On Tue Oct 27 15:22:07 2009, mockodin wrote:
Show quoted text> datetime or smalldatetime for the column type tried both
that's good.
Show quoted text> (mssql's timestamp is a non insertable type, used for incrementing , not a
> true timestamp)
Yes, I know - that is why I highlighted it.
Show quoted text> MSSQL should accept 2009-10-28 12:03 formatting perfectly fine, seconds
> being optional as is AM/PM
as I think my example showed but as I didn't have access to the native
client odbc driver at the moment I could not prove it - I am unix based.
Show quoted text>
> Further info not previously included, should have been though (sorry):
>
> Fails:
> do(undef, 'UPDATE bugs SET cf_window_end = ? WHERE bug_id = ?', undef,
> '2009-10-28 12:03', 132572)
>
> Succeeds:
> do(undef, 'UPDATE bugs SET cf_window_end = ? WHERE bug_id = ?', undef,
> '2009-10-28', 132572)
>
> However, executing the same action in query screen (Microsoft SQL Ser but
> without placeholders works:
>
> UPDATE bugs SET cf_window_end = '2009-10-28 12:01' WHERE bug_id = 132572
>
> It would appear to the untrained eye that implicit conversion from a
string
Show quoted text> or (n)varchar is working but when ? is used it fails, perhaps expects
a more
Show quoted text> rigorously formatted string?
There are workarounds in DBD::ODBC for datetimes. In the past we have
had them working but you needed to specify the seconds:
case SQL_TYPE_TIMESTAMP:
d_digits = 0; /* tbd: millisecondS?) */
if (SvOK(phs->sv)) {
char *cp;
if (phs->sv_buf && *phs->sv_buf) {
cp = strchr(phs->sv_buf, '.');
if (cp) {
++cp;
while (*cp != '\0' && isdigit(*cp)) {
cp++;
d_digits++;
}
}
} else {
/* hard code for SQL Server when passing Undef to
bound parameters */
column_size = 23;
}
and the problem (if there is any) is probably in this. I'll try and look
in to it more tomorrow. In the meantime if you can come up with a single
perl script (rather than the bugzilla example) which illustrates the
problem as succinctly as possible it would expedite a solution.
Martin
--
Martin J. Evans
Wetherby, UK