在PL/SQL中,可以使用以下方法批量导入数据:
INSERT INTO table2 (column1, column2, column3)
SELECT column1, column2, column3
FROM table1;
DECLARE
CURSOR cur_data IS
SELECT column1, column2, column3
FROM table1;
BEGIN
FOR rec_data IN cur_data LOOP
INSERT INTO table2 (column1, column2, column3)
VALUES (rec_data.column1, rec_data.column2, rec_data.column3);
END LOOP;
COMMIT;
END;
DECLARE
TYPE data_type IS TABLE OF table1%ROWTYPE;
data data_type;
BEGIN
SELECT column1, column2, column3
BULK COLLECT INTO data
FROM table1;
FORALL i IN 1..data.COUNT
INSERT INTO table2 (column1, column2, column3)
VALUES (data(i).column1, data(i).column2, data(i).column3);
COMMIT;
END;
以上是在PL/SQL中批量导入数据的几种常见方法,可以根据具体需求选择合适的方法进行操作。