-
Hello.
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?
Regards.
========
LARRY ELLISON
-
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:
http://www.oracle-base.com/Articles/...sFromPLSQL.asp
If you want to return host output consider using something like:
http://asktom.oracle.com/pls/ask/f?p...0_P8_DISPLAYID,F4950_P8_CRITERIA:3069633370832,%7Bshell%7D%20and%20%7Bcommands%7D%20and%20%7Bfrom%7D%20and%20%7BPL %2FSQL%7D
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|