用php PDO调用存储过程(firebird数据库) [英] Call stored procedure (firebird database) with php PDO
问题描述
我在firebird数据库上有一些存储过程. 现在,我想用PHP调用它们.
I have some stored procedures on a firebird database. Now I want to call them with PHP.
SP有一个暂挂代码和一个返回值,并且SP需要一些输入参数. 有人可以帮我吗...
SP have a suspend code and a return value and the SP need some input parameters.. Can someone help me...
推荐答案
Firebird不具有CALL
语法.如何调用SP取决于它是否可选(在主体中具有SUSPEND
语句).要调用可选的SP,请使用SELECT
语句:
Firebird doesn't have CALL
syntax. How to call the SP depends on whether it is selectable (has a SUSPEND
statement in it's body) or not. To call selectable SP you use SELECT
statement:
select outParam1, outParam2 from mySP(:inParam1, :inParam2)
可选的SP返回结果集,该结果集可以视为来自普通"选择语句的结果集.
The selectable SP returns resultset which can be treated as one resulting from an "ordianary" select statement.
要调用不可选择的SP,请使用EXECUTE PROCEDURE
:
To call non-selectable SP you use EXECUTE PROCEDURE
:
EXECUTE PROCEDURE mySP(:inParam1, :inParam2) RETURNING_VALUES(:out1, :out2)
这篇关于用php PDO调用存储过程(firebird数据库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!