Hi All
Requirement is to read a Sub-directory in the database and when ever a new Sub-directory is created in a particular Directory, we need a alert to be triggered in to the database. Alert can be of any form, even a insert into a table with all relevant details about the new directory created is enough.
If there is a way of achieving the above requirement without using the below methods please suggest those first before correcting the code below
We have tried with the utility given in this link.
[Oracle base| http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php]
and using the particular OS Command below */bin/ls -alrtd */ /tmp*
This command when executed from OS lists the directories created under /tmp including /tmp. Where as while executing from the below program does not behave so. I am not sure why and where i am going wrong.
DECLARE
L_OUTPUT DBMS_OUTPUT.CHARARR;
L_LINES INTEGER := 1000;
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
DBMS_JAVA.SET_OUTPUT(1000000);
HOST_COMMAND(' /bin/ls -alrtd */ /tmp ');
DBMS_OUTPUT.GET_LINES(L_OUTPUT, L_LINES);
FOR I IN 1 .. L_LINES LOOP
DBMS_OUTPUT.put_line(L_OUTPUT(I));
-- DO SOMETHING WITH THE LINE.
-- DATA IN THE COLLECTION - L_OUTPUT(I)
NULL;
END LOOP;
END;
Can the PRO's clarify and help me out of this.
Thanks in advance.