Odd issue with DBI/DBD::Sybase

"Wechsler, Steven" <[email protected]> Mon, 11 Feb 2008 16:10:08 -0500
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <9BFA664319211B4780C5F8A4FB060FF50121A2C0@LAZYTOWN.mtvn.ad.viacom.com>
I'm getting this error:

Unable to retrieve key from seclivesyb02 for 64152205: Implicit
conversion from datatype 'VARCHAR' to 'NUMERIC' is not allowed.  Use the
CONVERT function to run this query.

Here's the prepare statement:

$data_sth{$server} = $handles{$server}->prepare($sql_template);

Here's the SQL I'm preparing:

select  UserID, AttributeID, Rank from
nick_user_profile..up_UserAttribute  where UserID = ?

Here's the execute statement:

    $data_sth{$server}->execute(@$row);

@$row is a list with a single value: 64152205

And here is the table schema:

CREATE TABLE dbo.up_UserAttribute
(
    UserID      numeric(8,0) NOT NULL,
    AttributeID smallint     NOT NULL,
    Rank        smallint     NOT NULL,
    IntValue    numeric(8,0) NULL,
    TextCopy    varchar(255) NULL,
    StateID     tinyint      NOT NULL,
    TargetID    numeric(8,0) NULL,
    Title       varchar(255) NULL,
    Link        varchar(255) NULL,
    CONSTRAINT pk_UserAttribute
    PRIMARY KEY CLUSTERED (UserID,AttributeID,Rank)
)

Now, the really odd thing is that this script worked fine until
recently, when apparently SOMETHING (I'm not sure what) changed, and now
I cannot do any input parameter binding on any table; it always results
in this error.  Any ideas?

Thanks.



Steve Wechsler | [email protected]
Sybase/SQL Server/MySQL Database Administrator
212-846-5683

MTV Networks