2008-04-08
SQL:returning A into B/函数参数默认值/手动更改表值
(1)returning A into B
update work_order wo
set wo.start_qty = nvl(wo.start_qty, 0) + 1
where wo.order_type = 'ATO'
and wo.exception_flag = 0
and wo.order_number = p_work_order
returning wo.start_qty into v_start_qty;
returning A into B:
A is the top DML of parameter
B is the we define variable.
Give A value to variable B
The fuction is to account for subsequent
(2)函数参数默认值
v_pid varchar(10) := get_pid(p_psn);
function get_pid(p_psn in varchar2,
p_valid in pls_integer := 1)
The p_valid in pls_integer := 1 effect is
When user the get_pid no p_valid then it default 1.
The p_valid¡¨ is dispensable
(3)手动更改表值
select s.*,rowid from student s;
update work_order wo
set wo.start_qty = nvl(wo.start_qty, 0) + 1
where wo.order_type = 'ATO'
and wo.exception_flag = 0
and wo.order_number = p_work_order
returning wo.start_qty into v_start_qty;
returning A into B:
A is the top DML of parameter
B is the we define variable.
Give A value to variable B
The fuction is to account for subsequent
(2)函数参数默认值
v_pid varchar(10) := get_pid(p_psn);
function get_pid(p_psn in varchar2,
p_valid in pls_integer := 1)
The p_valid in pls_integer := 1 effect is
When user the get_pid no p_valid then it default 1.
The p_valid¡¨ is dispensable
(3)手动更改表值
select s.*,rowid from student s;
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 4238 次

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
NET判断输入是否为double ...
受教了!谢谢楼主
-- by liuzhenyu170 -
一个截取字符串的方法
呵呵谢谢各位,我是想让他成为一个通用的东西,以后在编写存储过程时,可以直接用,就 ...
-- by 心似海 -
动态SQL
既然是存储过程,当temp_str的值有很多的时候, 可以考虑把temp_str ...
-- by armorking -
一个截取字符串的方法
用函数跑得会比较慢。。。不如再来个表像二楼说的1:N 想了想,写成下面这样貌视 ...
-- by qiuyuanshan -
一个截取字符串的方法
明明A、B两个字段是1:N关系, 用两张主从关系的表来描述,非常轻松 却偏偏要把 ...
-- by armorking






评论排行榜