У меня есть эта процедура, которую я определил в Oracle:
CREATE OR REPLACE Procedure InsertCliente
(dni IN VARCHAR, nombre IN VARCHAR, apellidos IN VARCHAR, apellido2 IN VARCHAR, direccion IN VARCHAR,
CALLE IN VARCHAR, NUMERO IN NUMBER, PISO IN VARCHAR, CIUDAD IN VARCHAR, CODPOSTAL IN NUMBER,
telefono IN NUMBER, edad IN DATE, email IN VARCHAR)
IS
claveDireccion number;
BEGIN
IF apellido2 is null THEN
INSERT INTO Cliente(DNI,Telefono,Direccion,Email,Edad,Apellidos,Nombre)
VALUES (dni,telefono,direccion,email,TO_DATE(edad,'YYYY-MM-DD'),apellidos,nombre);
ELSE
claveDireccion := (SELECT ID_DIRECCION FROM DIRECCION@SCHEMA2BD2 WHERE ID_DIRECCION=Direccion);
IF claveDireccion is not null THEN
INSERT INTO TITULAR@SCHEMA2BD2(DNI,Nombre,Apellido1, Apellido2, Direccion,Telefono,Fecha_Nacimiento)
VALUES (DNI,Nombre,Apellidos, Apellido2, Direccion,Telefono,TO_DATE(Fecha_Nacimiento,'YYYY-MM-DD'));
ELSE
raise_application_error(-20001, 'La direccion proporcionada no existe');
END IF;
END IF;
END;
/
Но я получаю следующую ошибку от Oracle:
LINE/COL ERROR
-------- -----------------------------------------------------------------
13/22 PLS-00103: Encountered the symbol "SELECT" when expecting one of
the following:
( - + case mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
13/96 PLS-00103: Encountered the symbol ")" when expecting one of the
following:
LINE/COL ERROR
-------- -----------------------------------------------------------------
. ( * @ % & - + ; / at for mod rem <an exponent (**)> and or
group having intersect minus order start union where connect
||
20/6 PLS-00103: Encountered the symbol "IF" when expecting one of the
following:
; <an identifier> <a double-quoted delimited-identifier>
delete exists prior <a single-quoted SQL string>
Я не знаю, что там происходит. Это просто предложение выбора, которое присваивается переменной. Любая помощь?