0

Is it possible to create a table with multiple nested tables, such as this example?

create or replace type t_products is object(
    name varchar(20),
    price float(4,2),
    drinks col_drinks,
    foods col_foods
);
/

create table products of t_products nested table drinks, foods store as drink, food;

1 Answer 1

1

You can, but you need separate nested table .. store as ... clauses for them:

create table products of t_products
    nested table drinks store as drink,
    nested table foods store as food;

Also float can't have a scale, but you can use number anyway; and varchar should be varchar2.

db<>fiddle

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! It was very useful.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.