create or replace procedure PRC_GZF_BZ_YWSLID(ywslid in verchar2) as
L_YWSLID verchar2(30);
tpg_gzfspbnum verchar2(30);
begin
L_YWSLID:=ywslid;
tpg_gzfspbnum:='tpg_gzfspb'||L_SLIDID;
execute immediate'
create table tpg_gzfspbnum as select * from
GZF_ZFBZ.tpg_gzfspb@gzf_zfbz where ywslid = L_YWSLID;'
end PRC_GZF_BZ_YWSLID;
上面的SQL,如果創建表名的時候不用execute immediate' ‘又報錯,提示說begin和end之間必須要有東西。。。而且這樣會讀取不到上面的賦值.
求解怎麼解決賦值表名
execute immediate'
create table '||tpg_gzfspbnum||' as select * from
GZF_ZFBZ.tpg_gzfspb@gzf_zfbz where ywslid = '''||L_YWSLID||''';'