oracle怎么控制存储过程execute immediate的执行顺序?发现execute immediate创表a,然后execute immediate update表a执行不了?
create or replace procedure pro_t is
cursor c is
select table_name
from user_all_tables
where table_name in (select table_name
from user_tab_columns
where column_name = 'POSITION_ID');
tablename varchar2(100);
strinsert varchar2(1000);
begin
open c;
loop
fetch c
into tablename;
exit when c%notfound;--ä½ ä¹å没æ循ç¯éåºæ¡ä»¶
strinsert:= 'update '|| tablename ||' set POSITION_ID =1' ;--ä¹åsqlè¯å¥æ¼çæé®é¢
execute immediate strinsert;
end loop;
commit;
close c;
end;
strinsert := 'update ' || tablename || ' set POSITION_ID =1 and POSITION_NAME = ''æ°é¢åº''';
循ç¯å¿
é¡»è¦å¯¹
...怎么控制存储过程execute immediate的执行顺序?发现execute im
tablename varchar2(100); strinsert varchar2(1000);begin open c; loop fetch c into tablename; exit when c%notfound;--你之前没有循环退出条件 strinsert:= 'update '|| tablename ||' set POSITION_ID =1' ;--之前sql语句拼的有问题execute immediate strinsert; ...
在ORACLE数据库中,我使用IMP导入数据,错把数据导入到其他用户中。请问我...
select 'drop table '||table_name||';'from catwhere table_type='TABLE' 将会输出一批删除表的sql语句,执行一下这些SQL语句就可以了。 如下: declarebeginfor i in (select table_name from dba_tables where owner=:username) loopexecute immediate 'drop table '||:username||'.'||i.tablename;end l...