Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Cool Unanswered: PL/SQL executes command line statements.

    I have a scenario in which I wud need to call a windows service from an
    Oracle stored procedure. So basically, the stored procedure calls a
    windows service by running some command line statement. I need to know
    a way, by which i can run some command line statements or execute a
    batch file from the PL/SQL code. Oracle runs on a Windows 2000 box. The
    windows service will run, do some processing and exit. How can I
    achieve that.

    Thanks!

  2. #2
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    You can write your script like this:

    Code:
    SELECT sysdate FROM DUAL;
    HOST <some OS Command>
    WHENEVER OSERROR EXIT
    SELECT sysdate FROM DUAL;
    For a discussion on the WHENEVER clause you might check the Oracle Docs.

    A couple of things; no semi-colon on the end of your OS Command, and you have a few options on the OSERROR response such as ROLLBACK. Pretty handy.
    JoeB
    save disk space, use smaller fonts

  3. #3
    Join Date
    Mar 2004
    Posts
    3

    Unhappy HOST Statement not being identified in PL/SQL!

    Thanks Joe, but the problem is that the HOST statement works in SQLPlus, but its not a valid/recognized identifier in PL/SQL. If I do,

    SQL> HOST START IEEXPLORE.EXE (works)

    But if I have the same line in my PL/SQL program, i get an error that the identifier isn't valid.

    Any help!

    Thanks,
    Ricky

  4. #4
    Join Date
    Jun 2003
    Location
    Ottawa
    Posts
    105

    nope....but there are workarounds

    You're obsessed and distressed 'cuz you can't make any sense
    Of the ludicrous nonsense and incipient senescence
    That will deem your common sense useless

Posting Permissions

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