I'm starting with the procedures and I'm lost with these problems.
I do not understand why I get an error when I add the procedure because I think it's ok and neither does it cause an error in the end.
I attach the code.
Errors:
LINE/COL ERROR
10/1 PLS-00103: Encountered the symbol "DECLARE"
16/4 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
( begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge
Code:
CREATE OR REPLACE PROCEDURE INSERT_MOVIMIENTOS (
INSERTMOV_COD_BANCO IN NUMBER,
INSERTMOV_COD_SUCUR IN NUMBER,
INSERTMOV_NUM_CTA IN NUMBER,
INSERTMOV_FECHA_MOV IN DATE,
INSERTMOV_TIPO_MOV IN CHAR,
INSERTMOV_IMPORTE IN NUMBER
);
DECLARE
sql_str VARCHAR2(500):='';
BEGIN
sql_str:=sql_str||'INSERT INTO MOVIMIENTOS (';
dbms_output.put_line(sql_str);
END;
/
;
beforeDECLARE
. Check techonthenet.com/oracle/procedures.php – Jahirul Islam Bhuiyan;
is only one problem here. The other one is thatDECLARE
starts an anonymous block. An anonymous block cannot appear within the declaration section of another block. – Jeffrey Kemp