在PL/SQL中導入CSV數據可以通過以下步驟實現:
CREATE TABLE ext_table
(
column1 datatype,
column2 datatype,
...
)
ORGANIZATION EXTERNAL
(
TYPE ORACLE_LOADER
DEFAULT DIRECTORY directory_name
ACCESS PARAMETERS
(
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY comma
...
)
LOCATION ('file_name.csv')
)
REJECT LIMIT UNLIMITED;
INSERT INTO target_table
SELECT *
FROM ext_table;
注意事項: