I am trying to access some directory in C which is (C:/FilesDirectory) and am looking for an oracle procedure/script to fetch all files in this directory and insert them in a table in my database(insert files themselves). I created the directory like this
CREATE OR REPLACE DIRECTORY xml_dir AS 'C:/FilesDirectory)';
-- Create table to store XML file in
CREATE TABLE SCTHAPIS.xml_tab (
id NUMBER(10),
filename VARCHAR2(100),
insertdate date,
xml XMLTYPE
);
ALTER TABLE SCTHAPIS.xml_tab ADD (
CONSTRAINT xml_tab_pk PRIMARY KEY (id)
);
CREATE SEQUENCE SCTHAPIS.xml_tab_seq;
Now, I've created the directory, but I don't know how to get all the files inside this directory and insert them in my table in database. Any suggestions?