首页 > 解决方案 > 错误:ORA-06550:第 4 行,第 205 列:PLS-00103:在预期以下情况之一时遇到符号“文件结尾”:;

问题描述

我正在尝试从.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。

标签: oraclegrailsdatabase-migrationgrails-plugin

解决方案


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

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

declare

begin

end;
/

推荐阅读