Re: Odd issue with DBI/DBD::Sybase
"Jason L. Froebe" <[email protected]> Mon, 11 Feb 2008 14:13:54 -0800 (PST)
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <[email protected]> |
The query after the placeholder value is transformed: select UserID, AttributeID, Rank from nick_user_profile..up_UserAttribute where UserID = "64152205" try: select UserID, AttributeID, Rank from nick_user_profile..up_UserAttribute where UserID = convert(numeric(8,0), ?) Jason L. Froebe WebBlog http://jfroebe.livejournal.com Tech log http://www.froebe.net/blog Froebe Fibers http://www.froebe-fibers.com ----- Original Message ---- From: "Wechsler, Steven" <[email protected]> To: [email protected] Sent: Monday, February 11, 2008 3:10:08 PM Subject: Odd issue with DBI/DBD::Sybase Odd issue with DBI/DBD::Sybase 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