Re: DB_Nestedset, quoteIdentifier and Oracle
| From: | Olivier Mansour | Date: | Fri, 25 Nov 2005 18:45:49 +0000 |
| Subject: | Re: DB_Nestedset, quoteIdentifier and Oracle | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-40514@lists.php.net to get a copy of this message | ||
Le 25 nov. 05 à 09:38, Olivier Mansour a écrit :
Le 24 nov. 05 à 22:13, Justin Patrin a écrit :I am wondering a problem near DB_Nestedset instead of Oracle. I am going to write a new bug report in DB_Nestedset. Il leave this one untouch but I am not sure it s a bug ;-). thanks all OlivierOn 11/24/05, Olivier Mansour <omansour@gmail.com> wrote:I am using DB_Nestedset (not my own package) with Oracle 10g those insert query are generated : INSERT INTO table ("field1", "field2") VALUES ('toto', 'tata'); It should be INSERT INTO table (field1, field2) VALUES ('toto', 'tata'); DB_Nestedset use quoteidentier to quote field1 .... (function _values2InsertQuery) but maybe it is'nt the good function to use ?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) {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.return ($str);} because Oracle dont want identifier to be quoted.
thanks Olivier-- Justin Patrin-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php