问题
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