declare
cc tab1%rowtype;
ss tab2.storeid%type;
v_string varchar2(500);
begin
select * into cc from tab1 where rownum=1;
dbms_output.put_line(cc.cs);
v_string:='select storeid from tab2 where '||cc.cs||' = 0 and rownum = 1';
execute immediate v_string into ss;
dbms_output.put_line(ss);
end;
/
cc tab1%rowtype;
ss tab2.storeid%type;
v_string varchar2(500);
begin
select * into cc from tab1 where rownum=1;
dbms_output.put_line(cc.cs);
v_string:='select storeid from tab2 where '||cc.cs||' = 0 and rownum = 1';
execute immediate v_string into ss;
dbms_output.put_line(ss);
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29987527/viewspace-2120234/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29987527/viewspace-2120234/