Skip to content
Advertisement

How can I select from list of values in Oracle

I am referring to this stackoverflow answer:

How can I select from list of values in SQL Server

How could something similar be done in Oracle?

I’ve seen the other answers on this page that use UNION and although this method technically works, it’s not what I would like to use in my case.

So I would like to stay with syntax that more or less looks like a comma-separated list of values.

UPDATE regarding the create type table answer:

I have a table:

I use this script but it does not insert any rows to the BOOK table:

Script output:

But if I use this script it does insert new rows to the BOOK table:

Advertisement

Answer

You don’t need to create any stored types, you can evaluate Oracle’s built-in collection types.

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