--Bulk insert into table from an array. insertinto department_teststruct select*fromtable(cast(d2 as dept_array));
更新:
UPDATE Table1 O SET Col2 = NVL((select Col2 fromtable(p_inventory_array_in) T WHERE O.Col1 = T.Col1), Col2);
不能使用下面的方法来更新
UPDATE Table1 -- Error: PL/SQL: SQL Statement ignored SET Col2 = T. Col2 FROM Table1 O, (SELECT*FROMTABLE(p_array_in)) T --Error: PL/SQL: ORA-00933: SQL command not properly ended WHERE O. Col1 = T. Col1;
我们可以使用两个数租来进行更新,
forall i in1..array1.Count update table1 set col2 = array2(i) where col1 = array1(i);