Call stored procedure (firebird database) with php PDO [closed]

旧城冷巷雨未停 提交于 2019-12-13 04:47:28

问题


I have some stored procedures on a firebird database. Now I want to call them with PHP.

SP have a suspend code and a return value and the SP need some input parameters.. Can someone help me...


回答1:


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)

The selectable SP returns resultset which can be treated as one resulting from an "ordianary" select statement.

To call non-selectable SP you use EXECUTE PROCEDURE:

EXECUTE PROCEDURE mySP(:inParam1, :inParam2) RETURNING_VALUES(:out1, :out2)


来源:https://stackoverflow.com/questions/19709935/call-stored-procedure-firebird-database-with-php-pdo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!