Re: DB_Nestedset, quoteIdentifier and Oracle
| From: | Justin Patrin | Date: | Thu, 24 Nov 2005 21:13:27 +0000 |
| Subject: | Re: DB_Nestedset, quoteIdentifier and Oracle | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-40503@lists.php.net to get a copy of this message | ||
On 11/24/05, Olivier Mansour <omansour@gmail.com> wrote:
> Hello All,
>
> (please apologize for my english)
> I'am testing DB_Nestedset with an Oracle database and done two few
> changes to make it work
>
> 1/ patch for DB_Nestedset 1.3.6
>
> ligne 975
> replace : $parent['norder'] = is_null($tmp_order) ? 0 : $tmp_order;
> by : $parent['norder'] = (is_null($tmp_order) or empty($tmp_order)) ?
> 0 : $tmp_order;
Won't anything that is_null() also be empty()?
>
> 2/ why in the DB/oci8.php file there is no quoteIdentifier method ?
> I propose :
>
> function quoteIdentifier ($str) {
> return ($str);
> }
> because Oracle dont want identifier to be quoted.
>
Actually Oracle *does* support/want identifiers to be quoted. I'm the
one who added this functionality to DB and I've used it myself many
times. Oracle identifiers are quoted with double quotes. Since this is
the way that common.php implements quoteIdentifier() oci8.php doesn't
have to supply its own. If you're having a problem with quoting let us
know what version of oracle it is and what package is causing the
problem. If your version of oracle doesn't support quoting there
*should* be a way to turn it off in your package. Another solution
would be to create your own DB driver which extends oci8 and defines a
"null" quoteIdentifier.
--
Justin Patrin