j_ochoa has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I have a problem trying to insert into a column with data type as bigint and any help is much appreciated.
Database: Sybase
The error I get from the database is this:
Couldn't prepare statement: Server message number=257 severity=16 state=1 line=0 server=DEVEL1 procedure=DBD3 text=Implicit conversion from datatype 'VARCHAR' to 'BIGINT' is not allowed. Use the CONVERT function to run this query.
token_id column is a bigint data type
The conflicting line is where binding parameter 7
The code looks like this:
my $insert_sth = "INSERT INTO some_table (transaction_id, ccn_masked, cardholder_name, exp_month, exp_year, + card_type, token_id ) VALUES(?, ?, ?, ?, ?, ?, ? )"; my $q_result = $dbh->prepare($insert_sth) or die "Couldn't prepare sta +tement: " . $dbh->errstr; $q_result->bind_param(1, $txId, { TYPE => SQL_INTEGER } ); $q_result->bind_param(2, $add_data{'maskedccn'}); $q_result->bind_param(3, getCardholderName($self)); $q_result->bind_param(4, getExpMonth($self), { TYPE => SQL_INTEGER + }); $q_result->bind_param(5, getExpYear($self), { TYPE => SQL_INTEGER +}); $q_result->bind_param(6, getCardType($self)); $q_result->bind_param(7, 5114780000000000271, { TYPE => SQL_BIGINT + } ); $q_result->execute()or die "Couldn't prepare statement: " . $dbh->errs +tr;
|
---|