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

时间:2014-12-06 21:07:12

标签: oracle plsql oracle11g sqlplus

我的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;

我使用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:
         := . ( @ % ;

1 个答案:

答案 0 :(得分:1)

INSERT语句必须以semi-colon结尾。

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

作为一种良好做法,请始终在SQL*Plus中编译代码并执行SHOW ERROR。查看line number中的error stack。如果没有任何EXCEPTION块(或使用适当的异常处理),您将获得正确的行号。尝试debug您的代码,转到行号并验证。