I'm trying to execute the "dir" command from inside my PL/SQL script.
If I perform this within SQL*Plus, it's works:
SQL> host dir;
But if I write "host dir;" inside my PL/SQL script, I get this error message:
PLS-00103: Encountered the symbol "dir" when expecting one of the following: := . ( @ % ;
Can I execute OS commands from my PL/SQL script?
HOST is an SQL*Plus command, not a PL/SQL command. To run host commands from PL/SQL you need to use a Java stored procedure or a shared library via EXTPROC. Java is the easiest option:
If you want to return host output consider using something like:
Click Here to Expand Forum to Full Width