DBD::Sybase::st execute failed: Server message number=257 severity=16 state=1 line=0 server=DB_SERVER procedure=DBD2 text=Implicit conversion from datatype 'VARCHAR' to 'UNSIGNED INT' is not allowed. Use the CONVERT function to run this query.
Statement= UPDATE db..table
SET col =
:p1
-- %d
WHERE search_col = :p2
####
DBD::Sybase::db prepare failed: Server message number=12828 severity=16 state=1 line=1 server=DB_SERVER procedure=DBD2 text=The datatype of a parameter marker used in the dynamic prepare statement could not be resolved.
Statement= UPDATE db..table
SET
col
=
--?
CONVERT( UNSIGNED INT , :p1 )
-- %d
WHERE search_col = :p2
##
##
# SQL.
create table pqr
(
x numeric(9,0) not null
, y unsigned int not null
)
insert into pqr values( 0 , 0 )
# Perl
$n = 1;
# Works.
$dbh->do( q/UPDATE pqr SET x = ?/ , undef , $n );
$n = 2;
# Fails;
$dbh->do( q/UPDATE pqr SET y = ?/ , undef , $n );
$n = 3;
# works (same as %s, this is all string in the end).
$dbh->do( sprintf q/UPDATE pqr SET y = %d/ , $n );