oracle PLS-00103:在期望以下之一时遇到符号“文件结束”: := 。(@%;

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27336520/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 02:39:53  来源:igfitidea点击:

PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: := . ( @ % ;

oracleplsqloracle11gsqlplus

提问by Luis Enrique Moreno

What is wrong with my PLSQL?

我的 PLSQL 有什么问题?

CREATE OR REPLACE PROCEDURE REGISTRO_CLIENTE_TARJETA(
v_nombre IN VARCHAR2, 
v_ap_paterno IN VARCHAR2, 
v_ap_paterno IN VARCHAR2, 
v_rfc IN VARCHAR2, 
v_email IN VARCHAR2, 
v_direccion IN VARCHAR2, 
v_numero IN VARCHAR2, 
v_num_seg IN VARCHAR2, 
v_mes_exp IN VARCHAR2, 
v_anio_expiracion IN VARCHAR2)
AS
BEGIN 
INSERT INTO TARJETA_DE_CREDITO(TARJETA_ID, NUMERO, NUM_SEGURIDAD, MES_EXPIRACION, ANIO_EXPIRACION) 
VALUES(TARJETA_CREDITO_SEQ.NEXTVAL, v_numero, v_num_seg, v_mes_exp, v_anio_expiracion)

INSERT INTO CLIENTE(CLIENTE_ID,NOMBRE, AP_PATERNO, AP_MATERNO, RFC, EMAIL, DIRECCION, TARJETA_ID)
VALUES(CLIENTE_SEQ.NEXTVAL, v_nombre, v_ap_paterno, v_ap_paterno, v_rfc, v_email, v_direccion, (SELECT LAST_NUMBER FROM ALL_SEQUENCES WHERE SEQUENCE_NAME = 'TERCERO_SEQ'))

END;

I'm getting the following errors using the show errors command:

我使用 show errors 命令收到以下错误:

LINE/COL ERROR
-------- -----------------------------------------------------------------
14/1     PL/SQL: SQL Statement ignored
15/88    PL/SQL: ORA-00933: SQL command not properly ended
19/3     PLS-00103: Encountered the symbol "end-of-file" when expecting
         one of the following:
         := . ( @ % ;

回答by Lalit Kumar B

The INSERTstatements must end with a semi-colon.

INSERT语句必须以结束semi-colon

insert into table (columns list) values (values list);

insert into table (columns list) values (values list);

As a good practice, always compile your code in SQL*Plusand do SHOW ERROR. Look at the line numberin the error stack. Without any EXCEPTIONblock (or with proper exception handling), you would get the correct line number. Try to debugyour code by going to the line number and verify.

作为一个好习惯,总是编译你的代码SQL*Plus并执行SHOW ERROR. 看看里面line numbererror stack。没有任何EXCEPTION块(或适当的异常处理),您将获得正确的行号。debug通过转到行号并验证来尝试使用您的代码。