2010年6月28日星期一

Re: [fw-db] raw SQL to Zend_Db_Select ?

AFAIK there are no limits as to how complicated a Zend_Db_Expr object can be. All it does is it contains a substring of the SQL query. That substring could be anything. When $db->quote() encounters the Zend_Db_Expr object, it simply pulls the string out and returns it unchanged (i.e. unquoted).

It's possible to build very complex SQL queries using Zend_Db_Select. If you run into any specific problems feel free to post back here.

--
Hector


On Mon, Jun 28, 2010 at 9:21 AM, David Mintz <david@davidmintz.org> wrote:
Before I even start trying, I am wondering how difficult it is to re-fashion an elaborate SELECT query (MySQL) into a Zend_Db_Select object. There are things like IF() containing nested CASE statements. Are there  limits, for example, on how complicated a Zend_Db_Expr() can get?

I guess the other option is to create a view. The point is to have all the basic heavy lifting cleanly encapsulated and add more WHERE clauses programmatically.



--
Support real health care reform:
http://phimg.org/

--
David Mintz
http://davidmintz.org/



没有评论: