Req #74592 [Com]: prepared statement support
| From: | mikey at kiernan dot tech | Date: | Thu, 27 Feb 2020 08:23:50 +0000 |
| Subject: | Req #74592 [Com]: prepared statement support | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225742@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74592&edit=1
ID: 74592
Comment by: mikey at kiernan dot tech
Reported by: adambaratz@php.net
Summary: prepared statement support
Status: Open
Type: Feature/Change Request
Package: PDO DBlib
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Hi there,
We experience the same behaviour using pdo_dblib.
We are unsure of exactly why, but we've had to migrate to pdo_sqlsrv.
There are a few SO threads about this:
- https://stackoverflow.com/questions/42982136/laravel-mssql-adhoc-queries-instead-of-prepared
- https://stackoverflow.com/questions/38338596/non-emulated-prepared-statement-support-from-ms-sql-server-through-php-on-linux
Previous Comments:
------------------------------------------------------------------------
[2017-05-15 07:58:55] adambaratz@php.net
Description:
------------
DBlib doesn't directly support prepared statements, but could get most of the way there using
some generic stored procedures.
T-SQL offers sp_executesql:
https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-executesql-transact-sql
Sybase has options of its own:
http://stackoverflow.com/questions/5680960/equivalent-to-sp-executesql-in-sybase
These could likely be used in conjunction with dbbind(). If so, this would eliminate this
extension's hard requirement for emulated prepares. Testing with SQL Server has shown that
execution plans for queries executed with sp_executesql can be reused when the parameters change.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74592&edit=1