【发布时间】:2016-07-05 17:59:32
【问题描述】:
我在直接从 shell 脚本调用 SQL 命令时遇到问题。我的 shell 脚本包含以下命令:
set x = `sqlplus -S $ISLK_ORACLE_UID` <<EOF
delete from rc where rcd_id = 1 ;
update rcd set standard = 'Test_DB7' where id = 1 ;
delete from rc where rcd_id = 2 ;
update rcd set standard = '700' where id = 2 ;
delete from rc where rcd_id = 5 ;
update rcd set standard = 'DB7' where id = 5 ;
delete from rc where rcd_id = 998 ;
update rcd set standard = '2001-2050' where id = 998 ;
delete from rc where rcd_id=3004 ;
begin
for fd_rec in (select * from fd)
loop
insert into rc values(1008, 1, fd_rec.id, 'islk.am@swisscom.com') ;
end loop ;
end ;
commit;
EOF
单个命令(删除、更新)完成没有任何问题,但似乎没有执行 thw 循环(语句后没有插入任何内容)。有人知道问题可能是什么吗?
提前非常感谢 最好的祝愿 约尔格
【问题讨论】:
-
fd 表包含一些行?