Chapter -09 Creating Procedures 02
2013-04-19 16:51
316 查看
Using the IN、OUT、IN OUT Parameter Mode:Example
DEMO 03:IN OUT CALL WITH VARIABLEVARIABLE b_phone_no VARCHAR2(16) EXECUTE :b_phone_no := '01082375915' PRINT b_phone_no EXECUTE format_phone(:b_phone_no) PRINT b_phone_no --plsql block --call SQL> @s9_3_call_01 PL/SQL procedure successfully completed. B_PHONE_NO -------------------------------------------------------------------------------- 01082375915 PL/SQL procedure successfully completed. B_PHONE_NO -------------------------------------------------------------------------------- (010)8237-5915
Viewing OUT Parameters:Using SQL*PLUS Host Variables
1、Use SQL*Plus host variables.2、Execute QUERY_EMP using host variable.
3、Print the host variables.
Parameter Passing Methods
The PL/SQL compiler has two ways of passing an actural parameter to a subprogram:by reference:The compiler passes the subprogram a pointer to the actual parameter.The actual and formal parameters refer to the same memory location.
by value:The compiler assigns the value of the actual parameter to the corresponding formal parameter.The actual and fromal parameter refer to different memory locations.
IN->by reference(按照正常思维,容易混淆)
OUT 、IN OUT ->by value(按照正常思维,容易混淆)
Available Notations for Passing Actual Parameters
When calling a subprogram,you can write the actual parameters using the following notations:-Postional:Lists the actual parameters in the same order as the formal parameters
-Named:Lists the actual parameters in arbitrary order and uses the association operator(=>) to associate a named formal parameter with its acutal parameter
-Mixed:Lists some of the acutal parameters as positional and some as named
Prior to Oracle Database 11g,only the postional notation is supported in calls from SQL
Starting in Oracle Database 11g,named and mixed notation can be used for sepecifying arguments in calls to PL/SQL subroutines from SQL statements.
相关文章推荐
- [bbk2342] 第47集 - Chapter 09-Optimizing Sore Perations(02)
- [bbk2192] 第33集 - Chapter 09-Optimizing Sore Perations(02)
- Chapter 09-Manipulation Data - 02
- 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法
- Chapter 5-02
- 初识设计模式 chapter 09-迭代器与组合模式
- WGS-84,GCJ-02,BD-09的js转换
- 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法
- http://numbbbbb.github.io/the-swift-programming-language-in-chinese/chapter1/02_a_swift_tour.html
- 关于百度坐标系 (BD-09)与火星坐标系 (GCJ-02)以及WGS84坐标之间的互相转换
- 【零基础学习iOS开发】【02-C语言】09-流程控制
- IOS学习笔记 ---- 15/09/02
- Chapter 2-02
- [翻译]Team Geek -02- Chapter 1 - The Myth of the Genius Programmer(完)
- 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法
- 使用js对WGS-84 ,GCJ-02与BD-09的坐标进行转换
- [转载] 百科全说——范志红:揭秘超市食物摆放“潜规则”(10-02-09)
- Chapter 7-02
- [Learning You a Haskell for Great Goods!] chapter 02 believe the type
- Chapter -03 Writing Executable Statements 02