Oracle/PHP Issue 2004-04-15 - By Edgar Chupit
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.
prepare():
/**
* 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 >
*
* @(protected) string $query query to be prepared
* @(protected) 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: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
|
|