pb11.5 连接oracle数据库 执行sql语句 报错

ashinhao 2012-08-13 01:34:40
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

大家有没有遇到过,并且这样执行可行不可行


...全文
272 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ashinhao 2012-09-06
  • 打赏
  • 举报
回复
问题解决 估计可能是字符集的问题 换了一个Oracle数据库解决 可能在执行之前 需要根据数据库字符集对字符串进行以下处理
ych12333 2012-08-13
  • 打赏
  • 举报
回复
应该把语句赋值给STRING变量,完了再用EXECUTE 执行。
ashinhao 2012-08-13
  • 打赏
  • 举报
回复
不是过程 是直接运行 同样的方式 对应sqlserver数据库就没有任何问题
xuam 2012-08-13
  • 打赏
  • 举报
回复
仔细F1查看一下PB里调用过程的例子
begin
end
语句不是在PB里的.

1,076

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧