【问题标题】:Error: ORA-06550: line 4, column 205: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ;错误:ORA-06550:第 4 行,第 205 列:PLS-00103:在预期以下情况之一时遇到符号“文件结尾”:;
【发布时间】:2018-11-04 16:54:51
【问题描述】:

我正在尝试从 .sql 文件执行匿名块。我收到以下错误:

错误:

ORA-06550: line 4, column 205:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

;

匿名块如下:

BEGIN
FOR CUR_VAR IN (select id from opco where countrycode in ('IT','PT','DE','ES','GR','UK', 'IE','NL'))
LOOP
insert into vfservice (id, opco_id, name, service_order, service_template, version, service_key, enabled) values (SEQ_SERVICES_ID.nextval, CUR_VAR.id, 'My Vodafone', 0, 'REMOTE_ANONYMOUS', 0, 'SELFCARE',1);
insert into vfservice (id, opco_id, name, service_order, service_template, version, service_key, enabled) values (SEQ_SERVICES_ID.nextval, CUR_VAR.id, 'Vodafone Cloud', 1, 'REMOTE_AUTHENTICATED', 0, 'CONTENTBACKUP',1);
insert into vfservice (id, opco_id, name, service_order, service_template, version, service_key, enabled) values (SEQ_SERVICES_ID.nextval, CUR_VAR.id, 'Vodafone Contacts', 2, 'REMOTE_AUTHENTICATED', 0, 'CONTACTS',1);
end LOOP ;
END ;

我正在使用 grails 3.3.2 和数据库迁移工具和 oracle 10g。

【问题讨论】:

  • 在 Grails 中运行时,块的执行方式、时间和方式是什么?

标签: oracle grails database-migration grails-plugin


【解决方案1】:

只需将 / 放在文件末尾 :)

当您在匿名块中运行过程时,您需要使用以下语法:

declare

begin

end;
/

【讨论】:

  • 在末尾添加 / 后出现同样的错误。上述区块中的任何其他问题?它在第一个插入语句行显示错误。
  • 您是否尝试过通过 sqlplus/sqldeveloper 直接在数据库中运行这个,或者直接在 sqlplus 中从文件中运行 sql?
  • 是的,使用 sqldeveloper 成功执行。我是否缺少 grails 数据库迁移工具使用的一些设置?对于存储过程
  • 好吧,我是 oracle 开发人员,所以我帮不上什么忙。我不认为这是 oracle 问题,但可能是一些连接设置。
猜你喜欢
  • 1970-01-01
  • 2016-10-16
  • 1970-01-01
  • 2021-02-16
  • 2022-01-03
  • 2018-01-12
  • 2011-10-21
  • 2015-07-07
  • 1970-01-01
相关资源
最近更新 更多