How to pass an entire row (in SQL, not PL/SQL) to

2019-07-18 15:31发布

问题:

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.