By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,219 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,219 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.


Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.