But the support is in the server - this means that some code examples given in the DBI man page fail miserably. In particular, perldoc DBI mentions that to include NULL values from placeholders in a WHERE clause you need to do something like this:
This will fail miserably with Sybase, because Sybase will attempt to find the datatype of each placeholder by matching it with a column. The ? is null doesn't map to any column name, so Sybase returns an error.... WHERE (product_code = ? OR (? IS NULL AND product_code IS NULL))
Whether this is a behavior that is valid or not is maybe debatable, but the great advantage is that Sybase knows the datatype of each placeholder when you execute a prepared statement - no need to bind them with a specific datatype (and in fact using bind_param() with a datatype will ignore the hint).
Cross-platform APIs are non-trivial, and cross-platform programming with databases is even more so because various forms of SQL syntax can have a huge impact on performance.
Michael
In reply to Re: Re: DBI prepare_cached and DBD::Sybase
by mpeppler
in thread DBI prepare_cached and DBD::Sybase
by mpeppler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |