oracle procedure ussing Host() command(使用 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);
被消除时工作正常.
when host(l_message);
is eliminated works fine.
问题是什么,无论如何要创建一个使用 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 存储过程来调用调用 OS 命令.Oracle 发布了一个 2008 年关于从 PL/SQL 内部调用操作系统命令的白皮书,但还有很多其他内容(包括 Oracle Base,相当不错)
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 程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Host() 命令的 oracle 程序


基础教程推荐
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01