creare tabella basata su un tipo definito dall'utente
-
19-09-2019 - |
Domanda
Supponiamo che io sono un tipo definito dall'utente:
CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT
(
f1 varchar2(10),
f2 number(5)
);
Ora, voglio creare una tabella per contenere questi tipi. Posso fare quanto segue:
create table test_type_table (
test_type_field test_type
);
Questo mi dà una tabella con una colonna, test_type_field
.
C'è un modo semplice e automatizzato per creare invece una tabella tale che esso ha 2 colonne, f1
e f2
?. In modo che sia l'equivilent alla scrittura:
create table test_type_table (
f1 varchar2(10),
f2 number(5)
);
Soluzione
Hai provato:
create table test_type_table of test_type;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow