使用Host()命令的oracle过程 [英] oracle procedure ussing Host() command

查看:326
本文介绍了使用Host()命令的oracle过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在oracle过程中使用host()命令时遇到问题. 我写了非常简单的oracle代码.

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

CREATE OR REPLACE PROCEDURE 

run_command(command_i IN VARCHAR2)

IS
  l_message  VARCHAR2 (100);

BEGIN

  l_message  := 'cmd ' || command_i;

  host(l_message); 

END run_command;

消除host(l_message);时效果很好.

出什么问题了,反正可以创建使用host()的例程吗?

Whats the problem and is there anyway to create a routine which uses host()?

推荐答案

HOST 命令仅在SQL * Plus中可用,而在PL/SQL中不可用.

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

您可以使用Java存储过程来调用call OS命令. Oracle发布了关于在2008年从PL/SQL中调用OS命令的白皮书,但还有很多其他内容(包括

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)

这篇关于使用Host()命令的oracle过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆