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: "Raju, Ramakrishna (Equity)" <ramakrishna_raju at ml dot com>
Subject: RE: Sybase IQ bind parameter problem
Date: Mar 24 2005 4:27PM

Joe,
 
    Placeholders in the DBI interface for Sybase uses Dynamic SQL in ASE. In other words, the rules are defined by the ASE's Dynamic SQL.
 
    The particular update statement that you mention with placeholders in the SET clause & WHERE clause works fine with ASE. If the Dynamic SQL rules
are different in ASA or IQ, it may not work. Looking at the error text, it seems to come from ASA, not IQ per se. or is it an ASA error being reported by IQ.
 
    You could try the stored procedure route. That should definitely work.
 
    Looks like we may need separate drivers for ASE, ASA, IQ, Repserver, OpenServer. Michael, can you comment on this ?
 
Ram
 
    

-----Original Message-----
From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org]On Behalf Of Cumming, Joe
Sent: Thursday, March 24, 2005 6:18 AM
To: sybperl-l@peppler.org
Subject: Sybase IQ bind parameter problem



 

Hello,

 

I am unable to use bind parameters in a simple query using Sybase IQ when the column being bound to is not an integer.

 

The following code

 

my $sqlstmt =" UPDATE creditqr.VolCurveDef SET QuoteType = ? WHERE VolCurveDefID = ? ";

my $sth = $dbi->prepare($sqlstmt);

 

eval {

  $sth->bind_param( 1, 'SNAP', SQL_VARCHAR);

  $sth->bind_param( 2, 2672444, SQL_INTEGER);

  $sth->execute();

};

if ($@) {

  print $@;

}

 

Produces the error 

 

DBD::Sybase::st execute failed: Server message number=21 severity=14 state=0 line=0 text=ASA Error -1000187: Unable to implicitly convert column 'QuoteType' to datatype (varchar) from datatype (integer).

 

If I bind to just integer values however the db is quite happy.

 

Has anyone come across anything similar and know of a fix?

 

Thanks,

 

Joe

 

 





---------------------------------------------------------------------------------------------

The information contained in this transmission and any attached documents is privileged, confidential and intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby directed not to read the contents of this transmission, and are hereby notified that any disclosure, copying, distribution, dissemination or use of the contents of this transmission, including any attachments, or the taking of any action in reliance thereon, is strictly prohibited. If you have received this communication in error, please notify the sender and/or Citadel Investment Group (Europe) Ltd immediately by telephone at +44 (0) 20 7645 9700 and destroy any copy of this transmission.

Citadel Investment Group (Europe) Ltd is authorised and regulated by the Financial Services Authority (FSA Firm Ref No 190260).
Registered in England. Registration No. 3666898.
Registered Office: 10th Floor, 2 George Yard, Lombard Street, London EC3V 9DH
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------