Table Variable As a parameter In My sql Stored Procedures

随声附和 提交于 2020-06-13 08:06:26

问题


Can i pass table variable as a PARAMETER To a Stored Procedure in MySql


回答1:


If you want to pass a table into the stored procedure as parameter - then answer is no. Only scalar values can be passed.

The table can be accessed by its name directly; if you want to use that table name to construct and run new query in procedure, then have a look at prepared statements.




回答2:


yes

    TableA:
    MyId       MyNumber
    1          5
    2          6
    3          9


Select myNumber, MyStoredProcedure(MyNumber) from TableA where MyNumber > 5


来源:https://stackoverflow.com/questions/8118247/table-variable-as-a-parameter-in-my-sql-stored-procedures

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