PL/SQL 动态SQL

declare
msql varchar2(200);
row_id  varchar2(200);
begin
loop
row_id := 'AAATGiAAEAAAuLLAAA';
msql := 'select * from t3 where rowid='''||row_id || '''';
 execute immediate msql;
end loop;
end;

declare
msql varchar2(200);
id  NUMBER;
begin
loop
id := 90;
msql := 'select * from t3 where id='||id;
 execute immediate msql;
end loop;
end;




posted @ 2014-03-23 12:22  czcb  阅读(134)  评论(0编辑  收藏  举报