Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2014

    Unanswered: Stored procedure call .bat file located on DB2 windows server


    Fairly new to DB2
    Need to know is there any way i can call a .bat file located on Db2 windows server from a stored procedure.
    Basically I need disable windows service when a stored procedure is called.

    Plzzzzzzz HELP


  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    You can call an OS program from an external procedure (Java, C, or .Net). There are examples of external procedures in the manual.
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Note that I consider calling an external program from within a database (especially from a stored procedure) to be very dangerous. Especially if there is any risk of the external program stopping for input or hanging.

    I wouldn't approve any user-facing code that stopped, started, pause, or much of anything else a service of the operating system that supported my database server. This would fail the code review, every time and every way it was presented. Management might overrule me and approve the change, but as the DBA I would never approve it.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Feb 2008
    I thought that the following articles(by Knut Stolze, Sotaro Izuha) might be useful.

    Making Operating System Calls from SQL

    A UDF for File Output and Debugging from SQL

    Though, they were rather old,
    but you might be able to grasp an outline of issueing OS command/program from DB2.

Posting Permissions

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