Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This is indeed a common problem, and doing the lookups "manually" in the driver can be difficult.

DBD::Sybase will do the right thing for "normal" placeholders - i.e. for plain SQL statements. This is because the Sybase protocol performs this discovery for you, and so DBD::Sybase knows what type any parameter is (as an aside, this is also why the WHERE (product_code = ? OR (? IS NULL AND product_code IS NULL)) construct does NOT work with Sybase - there is no way to determine the type of the second placeholder!).

For exec some_proc ? statements DBD::Sybase works like MySQL. It would be possible to look up the type of each parameter, but it's an overhead that I didn't want to code into the driver. Hence DBD::Sybase will assume SQL_CHAR unless told otherwise.

The difference with MySQL is that Sybase won't accept a CHAR string where an INT/NUMERIC/FLOAT is expected, and throws an error - so at least you wouldn't be left wondering why it is slow... :-)

Michael


In reply to Re: DBD::mysql and binding placeholders by mpeppler
in thread DBD::mysql and binding placeholders by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-24 16:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found