2009年5月27日星期三

[fw-db] Nested sets and Zend_Db_Select

Hi,

I just want to use nested sets in my Zend Framework app.
I found this tutorial: http://dev.iordanov.net/archives/8
http://dev.iordanov.net/archives/8

My app can be used with MySql or Oracle DB -> and there's my problem:
The statements in this tutorial are written by hand and so they aren't
Oracle conform. I don't want to create different SQL-Strings for Mysql and
Oracle DB so I have to use the Zend_Db_Select to create the selects. But my
question is how to create statements like this:

SELECT COUNT(parent.{$this->_primary[1]}) - 1 as depth,
node.{$this->_toString}
FROM {$this->_name} AS node, {$this->_name} AS parent
WHERE node.{$this->_left}
BETWEEN parent.{$this->_left}
AND parent.{$this->_right}
GROUP BY node.{$this->_primary[1]}
ORDER BY node.{$this->_left}

Is it possible to create this statement using Zend_Db_Select??
I didn't found anything like this in the reference guide.
--
View this message in context: http://www.nabble.com/Nested-sets-and-Zend_Db_Select-tp23738200p23738200.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: