Doc #79579 [Csd]: odbc_exec does not prepare the SQL statement
Edit report at https://bugs.php.net/bug.php?id=79579&edit=1
ID: 79579
Updated by: cmb@php.net
Reported by: ondrej dot popelka at keboola dot com
Summary: odbc_exec does not prepare the SQL statement
Status: Closed
Type: Documentation Problem
Package: ODBC related
Operating System: Irrelevant
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2020-05-11 07:40:13] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=1098a2f35d41a1bb3bbab63a02e671d9d7a8e4ee
Log: Fix #79579: odbc_exec does not prepare the SQL statement
------------------------------------------------------------------------
[2020-05-10 09:01:10] ondrej dot popelka at keboola dot com
Description:
------------
The documentation for odbc_exec states that it does "Prepare and execute an SQL
statement". From the behavior and source code https://github.com/php/php-src/blob/a07e75aa65e6658e8180e261a4ee29bc5caa4f56/ext/odbc/php_odbc.c#L1357
it looks that it only executes the provided statement.
I understand that there may be some dispute in what "prepare" means. From the ODBC Spec http://www.simba.com/wp-content/uploads/2016/03/ODBC_specification.pdf
Page 81-82) abbreviated:
"When SQLExecDirect is called, the driver:
- Modifies the SQL statement to use the data source's SQL grammar.
- Retrieves the current parameter values.
- Sends the statement to the data source for execution.
- Returns any errors."
"When SQLPrepare is called, the driver:
- Modifies the SQL statement to use the data source's SQL grammar.
- Sends the statement to the data source for preparation.
- Stores the returned access plan identifier for later execution"
The odbc_exec function does not call SQLPrepare and it does not send the statement to the data
source for preparation. Neither it returns the access plan. Therefore it does not fulfill the
operations of SQLPrepare.
Expected result:
----------------
The documentation for odbc_exec states that it does:
Directly execute an SQL statement (using SQLExecDirect as specified in ODBC 1.0 Standard)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79579&edit=1
Thread (3 messages)