DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: run batch file from within PL/SQL code

  1. #1
    Join Date
    Mar 2002
    Posts
    56

    run batch file from within PL/SQL code

    How can I run a batch file from within a PL/SQL procedure? I'm using Oracle 10g/Win2003
    Thank you

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166

    Re: run batch file from within PL/SQL code

    Originally posted by gab
    How can I run a batch file from within a PL/SQL procedure? I'm using Oracle 10g/Win2003
    Thank you
    Have you tried DBMS_JOB?

  3. #3
    Join Date
    Mar 2002
    Posts
    56
    What I want is to be able to call the export utility from within a stored procedure. As a last resort, I could define a program with dbms_scheduler, then a job that executes that program just once and call that job that actually execute the export from the procedure. But I was hoping to avoid it by calling the export directly in the procedure, eventually within a wrapper(like shell function in VB)

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    for the nth time, you cannot run os commands from with pl/sql you will need to load some java up into the db to do that

  5. #5
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Originally posted by davey23uk
    for the nth time, you cannot run os commands from with pl/sql you will need to load some java up into the db to do that
    Why can't he use utl_file to append a line to his crontab file?

  6. #6
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    yeah nice idea actually. but only if you want to do it regularly. Still cant run os commands from pl/sql though

  7. #7
    Join Date
    Mar 2002
    Posts
    56
    Our OS is Windows

  8. #8
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Originally posted by gab
    Our OS is Windows
    There is a tool called winbatch. Use it to write a program that looks for batch files in a particular directory. When it finds a bat file it should run the file, delete it and then go to sleep for a period of time.

    Then write your procedure to create a file ending in bat with all of the commands that you want run. You can also dynamically create the parameter file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width