Search code examples
oracleplsqloracle10gdirectory

How can I create a directory on the file system?


How do you create a physical directory on the OS from within PL/SQL? I looked at the CREATE OR REPLACE DIRECTORY command but that doesn't do it. Neither does UTL_FILE appear to be capable.


Solution

  • In the end I did find an easier solution. Use

    select os_command.exec('mkdir /home/oracle/mydir') from dual;
    

    or simply

    x := os_command.exec('mkdir /home/oracle/mydir');