INSERT ALL
INTO table_1 (id, name)
values(id,name)
INTO table_2 (id, name)
values(id,name)
INTO table_other (id, name)
values(id, name)
SELECT id,name
FROM a;
INTO table_1 (id, name)
values(id,name)
INTO table_2 (id, name)
values(id,name)
INTO table_other (id, name)
values(id, name)
SELECT id,name
FROM a;
解决方案 »
- 为什么我运行自己编写的过程不能得出结果呢,哪里错了呢
- ORA-04098: trigger 'SYSTEM.POLICYPATHTABLE_TRG' is invalid and failed re-validat
- oracle使用utl_http的问题
- 用exp dump DB的时候,如何能指定过滤某张表? 50分求助
- "Oracle Database Configuration Assistant" 失败 如何解决(菜鸟问题)
- 怎么样在oracle中开始事务,回滚事务?
- 高分在线等 创建数据库问题
- sql 查询
- 在安装过程中出现了ora-03113:end-of-file on communication channel问题
- 简单问题,如何取得系统时间(只要年月日,不要时间)?谢谢!!!
- 好奇怪的问题!急!
- 我在oracle中创建了一个数据库,为什么在OME中可以看到,而在OMS中看不到呢?
CREATE PROCEDURE xxxx
(xx
..
xx)
ASBEGIN TRAN
insert to table1 ....
IF (@@ERROR <> 0)
begin
rollback tran
return -1
end
insert into table2 ...
IF (@@ERROR <> 0)
begin
rollback tran
return -1
end
COMMIT TRANif @@Error <> 0
Return -1
Else
Return 0
GO类似这样的功能在oracle中怎么实现?
IF SQL%ROWCOUNT = 0 --sql影响记录数
then
ROLLBACK;
en dif;
insert to table1 ....
IF SQL%ROWCOUNT = 0 --sql影响记录数
then
ROLLBACK;
end if;
CREATE OR REPLACE procedure ll_04 is
begin
insert to table1 ....
IF SQL%ROWCOUNT = 0 --sql影响记录数
then
ROLLBACK;
end if; insert to table2 ....
IF SQL%ROWCOUNT = 0 --sql影响记录数
then
ROLLBACK;
end if;
insert to table3 ....
IF SQL%ROWCOUNT = 0 --sql影响记录数
then
ROLLBACK;
end if;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
ROLLBACK;
end ll_04;