How to create a physical OS directory using PL/SQL.
Hi,
I need to create a physical OS directory using PL/SQL.
When tried the below code
CREATE OR REPLACE PROCEDURE APPS.xx_CreateDir (dirname VARCHAR) is
myfile utl_file.file_type;
buf VARCHAR2(20) := 'TEST';
stmt_cre_dir VARCHAR2(200):= 'CREATE OR REPLACE DIRECTORY ATTACHMENT_DIR AS ' || '''' ||dirname|| '''';
BEGIN
EXECUTE IMMEDIATE stmt_cre_dir;
myfile := utl_file.fopen('DIR','test.dat','w');
utl_file.put(myfile, buf);
utl_file.fclose(myfile);
EXCEPTION
WHEN others THEN
dbms_output.put_line(sqlcode || ' ' || sqlerrm);
END;
/
its not creating a physical directory.
Kindly help me solve this issue.
Thanks,