呵呵,谢谢你帮我问了这个问题。我在ITPUB上问了,没人知道。
这个问题简单说来就是:
存储过程中对于声明为ROWTYPE的变量,如何作INSERT。
这个问题简单说来就是:
存储过程中对于声明为ROWTYPE的变量,如何作INSERT。
解决方案 »
- 创建视图问题
- 怎么老提示我回复太快, 我根本没快啊, 一个小时发一帖也快么?
- 如何根据in里面的顺序排序
- 求一条 SQL 语句,谢谢
- 系统重装-ORACLE系统备份还原如何操作
- 新手(急)
- 关于with admin option!!!
- ORA-01034 (Oracle not available) ORA-27101 shared memory realm does not exist 急,在线等,请大虾帮忙
- 请问:Oracle中,要获取在一段时间内的创建的纪录,SQL语句应该如何写,给个例子好吗?
- 求帮忙!!!!!求个大神帮忙
- 请教高手Develop Suite的问题,马上给分!!
- 谁有办法实现我的这个目的
必须: 变量.字段1,变量.字段2 ...我想知道有没有什么快捷的方法??
一个个地用变量里面字段。
难道ORACLE这么让人失望?
declare
cursor c_rc is
select ....
where....
v_rc c_rc%rowtype;begin
open c_rc;
fetch c_rc into v_rc;
....
输出v_rc.col1
.....
end;
on commit PRESERVE ROWS
as
select * from all_objects where 1=0;alter table ao
add constraint
ao_pk primary key(object_id);insert into ao select * from all_objects;create table t1
as
select *
from all_objects
where rownum<= (select count(*)/2 from all_objects);alter table t1 add constraint t1_pk primary key(object_id);analyze table t1 compute statistics
for table for all indexes for all indexed columns;create table t2
as
select *
from all_objects
where rownum<= (select count(*)/2 from all_objects);alter table t2 add constraint t2_pk primary
key(object_id);
Table altered.analyze table t2 compute statistics
for table for all indexes for all indexed columns;
Table analyzed.So, t1 and t2 are for all intents and purposes the same -- we'll upsert them
from AO..declare
l_start number;
l_run2 number;
begin
l_start := dbms_utility.get_time;
for x in ( select * from ao )
loop
update t2 set ROW = x where object_id = x.object_id;
if ( sql%rowcount = 0 )
then
insert into t2 values X;
end if;
end loop;
commit;
l_run2 := (dbms_utility.get_time-l_start);
dbms_output.put_line( l_run2 || ' hsecs' );
end;