Calling another PL/SQL procedure within a procedure(在过程中调用另一个 PL/SQL 过程)
问题描述
我是 PL/SQL 的新手将不胜感激这方面的帮助.我创建了一个复制合同的程序.现在我想从这个过程中调用另一个过程,它将复制与我正在复制的合同相关的所有程序.一份合同可以有多个程序.
I'm new to PL/SQL & would greatly appreciate help in this. I've created a procedure to copy contracts. Now I want to call another procedure from within this procedure which shall copy all the programs related to the contract I'm copying. One contract can have multiple programs.
推荐答案
您只需在代码中输入过程的名称和参数即可调用过程,例如
You call a procedure by simply putting its name and parameters in your code, e.g.
begin
    dbms_output.put_line('Demo');
end;
或在一个过程中,
create or replace procedure demo
as
begin
    dbms_output.put_line('Demo');
end;
我使用 dbms_output.put_line 作为过程的示例,但显然任何其他过程都将以相同的方式调用:
I have used dbms_output.put_line as an example of a procedure, but obviously any other procedure would be called the same way:
begin
    foo;
    bar(1);
    demo(true, 'Bananas', date '2018-01-01');
end;
出于某种原因,许多初学者都想在过程调用之前添加 exec.我不知道它来自哪里,因为 PL/SQL 没有这样的关键字.可能他们正在考虑 SQL*Plus execute命令,可简写为exec.但是,SQL*Plus 是一个单独的命令行实用程序,它有自己的命令,与 PL/SQL 语言无关.
For some reason, many beginners are tempted to add exec before the procedure call. I don't know where that comes from because PL/SQL has no such keyword. Possibly they are thinking of the SQL*Plus execute command, which can be abbreviated to exec. However, SQL*Plus is a separate command line utility with its own commands that have nothing to do with the PL/SQL language.
这篇关于在过程中调用另一个 PL/SQL 过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在过程中调用另一个 PL/SQL 过程
				
        
 
            
        基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
 - 带有WHERE子句的LAG()函数 2022-01-01
 - MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
 - 从字符串 TSQL 中获取数字 2021-01-01
 - 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
 - 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
 - while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
 - CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
 - MySQL 5.7参照时间戳生成日期列 2022-01-01
 - ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
 
    	
    	
    	
    	
    	
    	
    	
    	
						
						
						
						
						
				
				
				
				