Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Using perl dbi and Sybase IQ doing insert with placeholder getting datatype error

by runrig (Abbot)
on Sep 10, 2015 at 17:12 UTC ( [id://1141575]=note: print w/replies, xml ) Need Help??


in reply to Using perl dbi and Sybase IQ doing insert with placeholder getting datatype error

You could try making the type explicit:
use DBI qw(SQL_VARCHAR); $sth->bind_param(1, $mrn, SQL_VARCHAR); $sth->execute();
Though it would be odd if it does work, because SQL_VARCHAR is supposed to be the default.
Update: The execute() docs say this:
If any arguments are given, then "execute" will effectively call "bind_param" for each value before executing the statement. Values bound in this way are usually treated as "SQL_VARCHAR" types unless the driver can determine the correct type (which is rare), or unless "bind_param" (or "bind_param_inout") has already been used to specify the type.
So that gives some credibility to explicitly declaring the type...maybe the driver is trying to be smart and interpreting your values as numbers, and while Sybase ASE might be able to handle that, perhaps Sybase IQ cannot.

Replies are listed 'Best First'.
Re^2: Using perl dbi and Sybase IQ doing insert with placeholder getting datatype error
by ckbbkc (Novice) on Sep 10, 2015 at 18:11 UTC

    Thank you very much! I tried your suggested solution. Unfortunately, explicitly declaring the type in the bind_param doesn't help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1141575]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found