怎样提高大批量insert数据的速度
作者: 王者之剑(http://www.albertsong.com/) 日期: 2008-05-23 09:44
Oracle 绑定变量的用法
作者: 王者之剑(http://www.albertsong.com/) 日期: 2007-11-18 19:53
关键字: Oracle 绑定变量(Bind Variable )
1.让Oracle自己绑定变量
set serverout on;
set timing on;
declare
l_sql varchar2(2000);
l_count number;
l_param1 varchar2(100);
l_param2 varchar2(100);
begin
l_param1:=’a';
l_param2:=’b';
select count(*) into l_count from table1 where col_1=l_param1 and col_2=l_param2;
dbms_output.put_line(l_count);
end;
/
在上面的情况,Oracle会自己绑定变量,即,如果参数保存在一个数组中,select语句放在一个循环中,
select 语句只会编译一次。
像这样
for i in 1..3
loop
select count(*) into l_count from table1 where col_1=l_param1 and col_2=l_pa
1.让Oracle自己绑定变量
set serverout on;
set timing on;
declare
l_sql varchar2(2000);
l_count number;
l_param1 varchar2(100);
l_param2 varchar2(100);
begin
l_param1:=’a';
l_param2:=’b';
select count(*) into l_count from table1 where col_1=l_param1 and col_2=l_param2;
dbms_output.put_line(l_count);
end;
/
在上面的情况,Oracle会自己绑定变量,即,如果参数保存在一个数组中,select语句放在一个循环中,
select 语句只会编译一次。
像这样
for i in 1..3
loop
select count(*) into l_count from table1 where col_1=l_param1 and col_2=l_pa
Advanced Oracle PL/SQL Programming with Packages
作者: 王者之剑(http://www.albertsong.com/) 日期: 2007-11-07 12:29
Oracle PL/SQL Programming, 2nd Edition
作者: 王者之剑(http://www.albertsong.com/) 日期: 2007-11-06 20:37
- 1










