Skip to content
Advertisement

How to store multiple rows in a variable in pl/sql function?

I’m writing a pl/sql function. I need to select multiple rows from select statement:

if i use:

it only stores one value, but i need to store all values that this select returns. Given that this is a function i can’t just use simple select because i get error, “INTO – is expected.”

Advertisement

Answer

You can use a record type to do that. The below example should work for you

So in your case, it would be something like

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement