DECLARE ll_count number(18,0):=0;
BEGIN select count(*) into ll_count from user_tables where table_name ='SFZZ_NEW';
if ll_count=0 then
begin
execute immediate 'CREATE TABLE SFZZ_NEW(
XH varchar2(20) NOT NULL,
XM varchar2(30) NOT NULL,
rxnd varchar2(4) NOT NULL,
BMDM varchar2(12) NOT NULL,
ZYDM varchar2(12) NOT NULL,
SFQJDM varchar2(13) NOT NULL,
SFQJMC varchar2(60) NOT NULL,
SFXMDM varchar2(12) NOT NULL,
SFXMMC varchar2(60) NOT NULL,
YJJE number(18, 2) NULL,
SJJE number(18, 2) NULL,
JMJE number(18, 2) NULL,
TFJE number(18, 2) NULL,
QFJE number(18, 2) NULL)';
end;
END IF;
end;
在sqldeveloper当中执行没有问题 通过pb直接执行sql语句报错
ORA-06550: line 1, column 35:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin function package pragma procedure subtype type use
<an identifier> <a double-quoted delimited-identifier> form
current cursor
The symbol "" was ignored.
ORA-06550: line 2, column 84:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-id
ORA-06550: line 3, column 24:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a b
大家有没有遇到过,并且这样执行可行不可行
------解决方案--------------------
仔细F1查看一下PB里调用过程的例子
begin
end
语句不是在PB里的.
------解决方案--------------------
应该把语句赋值给STRING变量,完了再用EXECUTE 执行。