dimanche 1 mars 2015

Stored Procedure in HSQLDB. Creation through SQLTool



I am trying to write a stored procedure. Creating it through the SQL browser goes well but when I save it in SQL file and load it through SQLTool it fails





CREATE PROCEDURE SP_GETNEXTSEQUENCE(OUT out_new_seq_no DECIMAL, IN in_seq_id DECIMAL)
MODIFIES SQL DATA
BEGIN ATOMIC
UPDATE SEQUENCE_GENERATOR SET seq_value=seq_value+1 where seq_id=in_seq_id;
select seq_value into out_new_seq_no from SEQUENCE_GENERATOR where seq_id=seq_id;
END;
.;




I receive below error



Exception in thread "main" java.lang.Error: Error: could not match input
at org.hsqldb.cmdline.sqltool.SqlFileScanner.zzScanError(Unknown Source)
at org.hsqldb.cmdline.sqltool.SqlFileScanner.yylex(Unknown Source)


call made SqlTool.objectMain(sqlToolParams);


where



String [] sqlToolParams = {"--inlineRc", "URL="+"jdbc:hsqldb:mem:TestDB", SCHEMAPATH};


I need help with correcting the syntax.


I tried to get clues from http://ift.tt/1zACwkq


but seems like my understanding is not adequate enough


added Question -- Does SQL file need to be any specific encoding




Aucun commentaire:

Enregistrer un commentaire