I have this datatype declared and afterwards populated:
CREATE OR REPLACE TYPE CRAMER."T_CREATELINK_PORTLIST" IS TABLE OF o_CreateLink_PORTLIST;
AND
TYPE o_CreateLink_PORTLIST AS OBJECT (
PORTNAME VARCHAR2(50),
PORTID NUMBER,
ISNEWPORT NUMBER,
SHELFNAME VARCHAR2(50),
SLOTNAME VARCHAR2(50),
BANDWIDTHNAME VARCHAR2(50),
ISSELECTED NUMBER );
What I want to do is get some object/s from one table of this type to another table of same type. Something like this:
lsa_all_ports cramer.t_CreateLink_PORTLIST;
INSERT INTO lsa_filter_ports VALUES( SELECT *
FROM TABLE(CAST(lsa_all_ports AS cramer.t_CreateLink_PORTLIST)) new
WHERE new.bandwidthname = 'band2');
I'm pretty sure this syntax is wrong, but is there a simple way to do this??
Other atempts:
SELECT * INTO lsa_filter_ports
FROM TABLE(CAST(lsa_all_ports AS cramer.t_CreateLink_PORTLIST)) new
WHERE new.bandwidthname = 'band2';
ORA-06550: not enough values
lsa_filter_ports cramer.t_CreateLink_PORTLIST := cramer.t_CreateLink_PORTLIST();
INSERT INTO lsa_filter_ports
(SELECT * FROM TABLE(CAST(lsa_all_ports AS cramer.t_CreateLink_PORTLIST))
WHERE bandwidthname = 'band2');
ORA-00942: table or view does not exist