PLSQL中的两种传参方式:Positional Notation VS Named Notation(即=>符号)
来源:互联网 发布:淘宝信用卡套现方法 编辑:程序博客网 时间:2024/06/16 18:56
原文链接:http://blog.csdn.net/tsingyee/article/details/6045598
位置标示法(Positional Notation)VS名字标示法(Named Notation,即=>符号)
在调用子程序时,我们既可以使用位置标示法又可以使用名字标示法来编写实参。也就是说,我们可以按位置或名称来把实参和形参关联起来。如下例所示:
DECLARE
acct INTEGER;
amt REAL;
PROCEDUREcredit_acct(acct_no INTEGER, amount REAL) IS ...
我们可以使用四种等价的方法来调用过程credit_acct:
credit_acct(acct,amt); -- positional notation
credit_acct(amount =>amt, acct_no => acct); -- named notation
credit_acct(acct_no =>acct, amount => amt); -- named notation
credit_acct(acct, amount=> amt); -- mixed notation
1、使用位置标示法
第一个过程调用使用了位置标示法。PL/SQL编译器将第一个实参acct和第一个形参acct_no关联,并把第二个实参amt和第二个形参amount关联。
2、使用名字标示法
第二个过程调用使用了名字标示法。箭头(=>)作为关联操作符,把左边的实参和右边的形参关联起来。
第三个过程调用也使用了名字标示法,而且我们可以随意安排参数的位置。所以,我们不需要知道形参的在参数列表中的顺序。
3、使用混合标示法
第四个过程调用使用了名字标示法和位置标示法。在这种情况下,位置标示法必须在名字标示法之前,不能反过来使用,像下面这样的调用方法就是不合法的:
credit_acct(acct_no => acct,amt); -- illegal
- PLSQL中的两种传参方式:Positional Notation VS Named Notation(即=>符号)
- python: 切片符号(slice notation)
- Dot notation vs. bracket notation when retriving object property values
- JSON (JavaScript Object Notation)
- 数学的记号(notation)
- 记号(notation)的学习
- 3. Prerequisites and Notation 预备知识和符号约定(《MACHINE LEARNING YEARNING》翻译)
- hungariant notation
- Dot Notation
- CIDR Notation
- Dot Notation
- Hungarian Notation
- Prefix Notation
- Asymptotic notation
- Yoda Notation
- Exponential notation
- do notation
- Known Notation
- hive中文件三种压缩方式
- [Android Studio] always goes wrong "meata_data" "cant find API 21" when import a prj from eclipse
- 硬件编程语言和编程器件
- LeetCode 386 Lexicographical Numbers
- js正则表达式--String的几个正则表达式方法
- PLSQL中的两种传参方式:Positional Notation VS Named Notation(即=>符号)
- Android stdio 编辑技巧
- Unity3D中的线性插值Lerp()函数解析
- 17 猴子吃桃
- Linux线程编程 - 线程同步机制之条件变量
- 错误和异常处理
- Golang1.7闲来无事写了一个基于Gob的tcp通讯用的包
- question for write
- Reveal使用教程