php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #23019 Allow PHP to prepare Informix cursors with "placeholders"
Submitted: 2003-04-02 08:59 UTC Modified: 2009-05-04 15:10 UTC
From: johnson at nicusa dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.3.1 OS: Solaris 8
Private report: No CVE-ID: None
 [2003-04-02 08:59 UTC] johnson at nicusa dot com
With many other languages that access an Informix database, a placeholder (question mark) in the VALUES list is passed in a string as an argument in the USING clause of the EXECUTE (or PUT) statement:

EXEC SQL PREPARE p FROM "INSERT INTO SomeTable VALUES(..., ?, ...)";
EXEC SQL EXECUTE p USING :very_long_string_variable;

The same technique works with UPDATE, of course. PHP doesn't accept placeholders, so that's problematic. The ability to prepare a statement one time at the beginning of say, a large load or update process or a query used many times (probably happen more in CLI than CGI) is MUCH more efficient, as the engine does not have to have PREPARE and FREE in the loop every time the cursor is executed.

I suggest that the function ifx_prepare be changed to accept question marks as placeholders in the query.

Then ifx_do could be coded to accept a series of arguments, or just an array containing arguments in the proper order to populate the cursor query before execution.

Thanks for your consideration. jj.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-04 15:10 UTC] pajoye@php.net
Report IFX request via pecl.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 17:01:29 2024 UTC