dmacdou has asked for the wisdom of the Perl Monks concerning the following question:
DBD::ODBC::st execute failed: [MERANT][ODBC Sybase ASE driver][SQL Ser +ver]Implicit conversion from datatype 'VARCHAR' to 'NUMERIC' is not a +llowed. Use the CONVERT function to run this query.
use DBI; my $dbh = DBI->connect('dbi:ODBC:Data Source', 'username', 'passwor +d', {RaiseError => 1,}); my $sth = $dbh->prepare('SELECT customercode FROM customerorde +rs WHERE ordercode = ?') or die "Couldn't prepare statement: " . $dbh->errstr; print "Enter ordercode> "; while ($ordercode = <>) { # Read input from the user my @data; chomp $ordercode; $sth->execute($ordercode) # Execute the query or die "Couldn't execute statement: " . $sth->errstr; # Read the matching records and print them out while (@data = $sth->fetchrow_array()) { my $customercode = $data[1]; my $ordercode = $data[2]; print "\t $customercode $ordercode\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32 - DBD-ODBC - Sybase
by VSarkiss (Monsignor) on Oct 20, 2005 at 23:18 UTC | |
by dmacdou (Novice) on Oct 21, 2005 at 17:03 UTC | |
by VSarkiss (Monsignor) on Oct 21, 2005 at 17:54 UTC | |
by dmacdou (Novice) on Oct 21, 2005 at 19:24 UTC | |
|
Re: Win32 - DBD-ODBC - Sybase
by mpeppler (Vicar) on Oct 21, 2005 at 19:11 UTC | |
by dmacdou (Novice) on Oct 21, 2005 at 20:30 UTC |