I am trying to insert values to a nested table with an object of another table. This is what I'm trying (Sorry, I'm new working with dbs):
INSERT INTO Ocurrences (..., oSpace) VALUES
(other inserts,
/* insert I don't know to do it to nested table oSpaces */
);
How I could add a value in oSpaces inserting an object from table Spaces?
Thanks.
Just use a collection of
REFerences:db<>fiddle here
As an aside,
'20/02/2020'is not aDATEdata-type, it is a string literal and relies on an implicit string-to-date conversion. This implicit conversion will fail if the user'sNLS_DATE_FORMATsession parameter does not match your string's format and since any user can change their session parameters at any time then this is not something you should rely on.Instead, you should use:
DATE '2020-02-20'; orTO_DATE('20/02/2020', 'DD-MM-YYYY').