oracle procedure ussing Host() command

前端 未结 2 1374
余生分开走
余生分开走 2021-01-21 19:36

I am having a problem using host() command in oracle procedure. I have written very simple oracle code.

CREATE OR REPLACE PROCEDURE 

run_command(c         


        
相关标签:
2条回答
  • 2021-01-21 20:02

    The HOST command is only available in SQL*Plus and not from PL/SQL.

    You can use Java stored procedure to call call OS commands. Oracle released a white paper on calling OS commands from within PL/SQL back in 2008 but there's plenty of other stuff out there (including Oracle Base, which is quite good)

    0 讨论(0)
  • 2021-01-21 20:06

    Another clunky, but non-Java way would be to create DBMS_SCHEDULER ad-hoc EXECUTABLE job which is your HOST command (e.g. ls ), and then execute the job.

    Note these run on the database server, not on your remote/local client.

    0 讨论(0)
提交回复
热议问题