Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re[4]: Oracle/PHP Issue

Re[4]: Oracle/PHP Issue

From: Edgar Chupit <>
Date: Fri, 16 Apr 2004 06:20:26 +0300
Message-ID: <>

Hello Mladen,

MG> used directly. Theoretically speaking, it is possible to execute SQL without
MG> bind & define calls, but it would definitely cause mayor problems with the code
MG> design. Below is the list of the DB functions from the PEAR site and, unless

First of all, I've used DB functions myself only once, and it was just testing, so I may miss something, but I guess you are correct that this library, because of abstraction level, doesn't have things like define_by_name, it does have build in binding, but you still will have problems when you'll want custom type binds, like ref cursors or anything else. But for "generic" types it will work fine.



* Prepares a query for multiple execution with execute().
* With oci8, this is emulated.
* prepare() requires a generic query as string like <code>
* INSERT INTO numbers VALUES (?, ?, ?)
* </code>. The <kbd>?</kbd> characters are placeholders.
* Three types of placeholders can be used:
* + <kbd>?</kbd> a quoted scalar value, i.e. strings, integers
* + <kbd>!</kbd> value is inserted 'as is'
* + <kbd>&</kbd> requires a file name. The file's contents get
* inserted into the query (i.e. saving binary
* data in a db)
* Use backslashes to escape placeholder characters if you don't want
* them to be interpreted as placeholders. Example: <code>
* "UPDATE foo SET col=? WHERE col='over \& under'"
* </code>
* @param string $query query to be prepared
* @return mixed DB statement resource on success. DB_Error on failure.
and than you have to pass data to the execute() function. I think, like with any open source software you have some choice: * you can use it as is, * you can adapt it to fit your needs, * you can throw it away. It is up to you what way to chose :) -- Edgar ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: ---------------------------------------------------------------- To unsubscribe send email to: put 'unsubscribe' in the subject line. -- Archives are at FAQ is at -----------------------------------------------------------------
Received on Thu Apr 15 2004 - 22:17:04 CDT

Original text of this message