How to pass an entire row (in SQL, not PL/SQL) to a stored function?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 13:38:19

问题


I am having the following (pretty simple) problem. I would like to write an (Oracle) SQL query, roughly like the following:

SELECT count(*), MyFunc(MyTable.*)
FROM MyTable
GROUP BY MyFunc(MyTable.*)

Within PL/SQL, one can use a RECORD type (and/or %ROWTYPE), but to my knowledge, these tools are not available within SQL. The function expects the complete row, however. What can I do to pass the entire row to the stored function?

Thanks!


回答1:


Don't think you can.

Either create the function with all the arguments you need, or pass the id of the row and do a SELECT within the function.



来源:https://stackoverflow.com/questions/4585377/how-to-pass-an-entire-row-in-sql-not-pl-sql-to-a-stored-function

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