2008年8月10日星期日

Re: [fw-db] Zend_Db_Table_Abstract and stored procedures

Thanks for the clarifications Bill.

Actually I 'partially' found a solution for it.

The reason I wanted to run stored procedures was to use an intermediate step from migrating a legacy application towards a new format of columns/column names and table names while enjoying the power of Zend_Db_Table_Abstract.

I can use the properties/methods of Zend_Db_Table_Abstract to mask the legacy application. That should give me the functionality required.

Thanks again!

On Sun, Aug 10, 2008 at 6:26 PM, Bill Karwin <bill@karwin.com> wrote:



Nikos Dimopoulos wrote:
>
> Is it possible to bind a Zend_Db_Table_Abstract with a stored procedure?
>

Nope.

Zend_Db_Table assumes that it can use SELECT to gather data from a table.
Most database brands don't support queries with a procedure as a table
source e.g. "SELECT * FROM procedurename(arg)".  PostgreSQL and
InterBase/Firebird being exceptions that do support this syntax.

I'm not aware of any brand of database that supports a procedure as a target
of INSERT, UPDATE, or DELETE.  Zend_Db_Table also assumes these operations
act against a table.

The next question you may ask is how to call a stored procedure in Zend
Framework if not by using Zend_Db_Table.  You have to write the full SQL
statement using whatever syntax is supported by your brand of database, and
execute the statement with Zend_Db_Adapter methods like query().

There are no specific methods or tests in Zend_Db for stored procedures.

Regards,
Bill Karwin
--
View this message in context: http://www.nabble.com/Zend_Db_Table_Abstract-and-stored-procedures-tp18917526p18917757.html
Sent from the Zend DB mailing list archive at Nabble.com.




--
The contents of this message may contain confidential or privileged information and is intended solely for the recipient(s). Use or distribution to and by any other party is not authorized. If you are not the intended recipient, copying, distribution or use of the contents of this information is prohibited.

没有评论: