RE: Problem with DBD::Sybase using Sybase IQ
"Cumming, Joe" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <3F6DC98F71C43745919CC8705A555D2802B832C8@CIGEMAIL.chi.citadelgroup.com> |
Thanks Rama, I'll try that out. Can I ask a follow-up question? I cane across this error while trying to get Class::DBI to work with Sybase IQ. The code below is how Class::DBI does its updates. Have you (or anyone) been able to get Class::DBI to work with Sybase IQ. Thanks in advance, Joe ________________________________ From: Raju, Ramakrishna (Equity) [mailto:[email protected]] Sent: 23 March 2005 17:16 To: Cumming, Joe; [email protected] Subject: RE: Problem with DBD::Sybase using Sybase IQ Joe, You should be using the bind_param() to specify the type of the parameter, like $stmt->bind_param( 1, "jc", SQL_VARCHAR ); $stmt->bind_param( 2, "2005-02-28", SQL_DATETIME ); ... ... and then, $stmt->execute(); At the top, instead of "use DBI;" , say "use DBI qw(:sql_types);" . This should import the sql types into your .pl . Ram [Raju, Ramakrishna (Equity)] -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Cumming, Joe Sent: Wednesday, March 23, 2005 9:17 AM To: [email protected] Subject: Problem with DBD::Sybase using Sybase IQ Hello, I have a problem running execute() in DBD::Sybase when it has bind parameters. The following code my $sqlstmt =<<'EOST'; INSERT INTO creditqr.Tenor (MartModifiedID, MartSnapDate, ShortName, Tenor, TenorID) VALUES (?,?,?,?,?); EOST my $stmt = $dbi->prepare($sqlstmt); my @values = ('jc', "2005-02-28", "Test", 100, 500); $stmt->execute(@values); 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 'MartModifiedID' to datatype (varchar) from datatype (integer). * (db_sqlins.cxx 10136) at dbitst.pl line 16. However, the code my $sqlstmt =<<'EOST'; INSERT INTO creditqr.Tenor (MartModifiedID, MartSnapDate, ShortName, Tenor, TenorID) VALUES = ('jc', "2005-02-28", "Test", 100, 500); EOST my $stmt = $dbi->prepare($sqlstmt); $stmt->execute(); works fine. Has anyone come across anything similar and know of a fix? Thanks, Joe ________________________________ 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 <http://www.ml.com/email_terms/> for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ ________________________________ ------------------------------------------------------------------------ --------------------- 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