通过 Zend Framework 执行 MSSQL 存储过程 [英] Execute MSSQL stored procedure via Zend Framework

查看:34
本文介绍了通过 Zend Framework 执行 MSSQL 存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请求:请向我展示如何使用 Zend Framework 从 MSSQL 服务器上的存储过程中检索(在数组中?)返回的行并将参数传递给存储过程的工作示例.

Request: Please show me a working example of how to retrieve(in an array?) returned rows from a Stored Procedure on a MSSQL server using Zend Framework and passing parameters to the stored procedure.

说明:我在 ZF 文档中找不到关于如何在 MSSQL 服务器上执行 SP 的任何内容.我知道可以通过普通的 PHP 来实现.但是,由于我的项目使用 ZF,我不想有额外的代码来打开与服务器的连接等.通过 ZF 代码挖掘我看到诸如bindParam"和execute"和prepare"之类的东西".但是,我不知道这些是如何工作的,也不知道我将如何处理它们.所以当然对请求的示例代码进行一些解释会非常好.

Explanation: I can't find anything in the ZF docs about how to execute SP on MSSQL servers. I'm aware that it is possible via plain PHP. However, since my project uses ZF, I'd like not to have to have extra code to open a connection to the server, etc. etc. Digging through the ZF code I see things like "bindParam" and "execute" and "prepare". However I have no idea how these work or what I am to do with them. So of course a bit of explanation to the requested example code would be very nice.

顺便说一下,我正在使用 Zend_Db_Adapter_Pdo_Mssql.

I'm using Zend_Db_Adapter_Pdo_Mssql by the way.

谢谢!

推荐答案

很抱歉,您无法在 ZF AFAIK 的当前状态下运行存储过程为什么......在这里看看

i am sorry to say you can't run stored Procedure in current state of ZF AFAIK why ..... take a look here

缺少什么?

一些长期运行的呢?Zend Db 的功能请求,例如存储过程、字符集和支持无法运行的查询准备好的陈述?关于什么澄清a之间的区别模型和数据层?

What about some of the long-running feature requests for Zend Db, like stored procedures, character sets, and support for queries that can’t run as prepared statements? What about clarifying the difference between a Model and a data layer?

来源:http://www.phparch.com/2010/06/25/zend-db-2-0-kicks-off/

更新:在我回答你之后,我从谷歌那里得到了这个链接,我认为值得一提

update : after i had answered you , i got this link from google , and i think it worth mentioning

http://zend-framework-community.634137.n4.nabble.com/mssql-pdo-lastInsertID-with-a-stored-procedure-td672685.html

这篇关于通过 Zend Framework 执行 MSSQL 存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆