PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Wechsler, Steven" <Steven dot Wechsler at mtvstaff dot com>
Subject: Odd issue with DBI/DBD::Sybase
Date: Feb 11 2008 9:10PM

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 | steven.wechsler@mtvstaff.com
Sybase/SQL Server/MySQL Database Administrator
212-846-5683

MTV Networks