Connecting Tech Pros Worldwide Help | Site Map

SQL0104N An unexpected token "END-OF-STATEMENT" was found

Najm Hashmi
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi all ,
I am trying to create a store procedure and I get the following error:
SQL0104N An unexpected token "END-OF-STATEMENT" was found
following "END". Expected tokens may include: "JOIN
<joined_table>
Explanation:

A syntax error in the SQL statement was detected at the specified
token following the text "<text>". The "<text>" field indicates
the 20 characters of the SQL statement that preceded the token
that is not valid.

Here is list of my coding:
CREATE PROCEDURE GetDate
(
IN P1 INTEGER,
IN P2 INTEGER
)
SPECIFIC TITLDTITASBYTITACT
LANGUAGE SQL
BEGIN
DECLARE SQLCODE INTEGER DEFAULT 0;
DECLARE S_SQLCODE INTEGER DEFAULT 0;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND
SET S_SQLCODE= SQLCODE;
DELETE FROM TITLEASSIGN
WHERE (((TITLEASSIGN.TITLEID) = P1)
AND ((TITLEASSIGN.TASKID) = P2))
;
END

Thanks in advance for your help.




dotyet
Guest
 
Posts: n/a
#2: Nov 12 '05

re: SQL0104N An unexpected token "END-OF-STATEMENT" was found


you need to terminate your procedure code with some special character
like @. the default character for procedure termination is ; but since
it is used as a terminator of your SQL statements, you are getting the
error. put an @ character after your END in the code, then compile your
procedure with the following command:

db2 -td@ -f <your_proc_file.sql>

if it does not work, then put the output (as well as the command you
use to compile the proc) again on this forum.

regards,
dotyet

Closed Thread