1

I'm using db2 and SQuirreL SQL

I'm trying to create a stored procedure with a simple select statement inside of it. When I omit the select statement in the following below and run the code, the procedure is created. Also this procedure can be dropped and called.

    CREATE PROCEDURE test_procedure
    LANGUAGE SQL
    BEGIN

    END

When I add in the select statement, I get Error: DB2 SQL Error: SQLCODE=-102, SQLSTATE=42601,...

    CREATE PROCEDURE test_procedure
    LANGUAGE SQL
    BEGIN
        SELECT column_name FROM table_name
    END

If you go to IBM iseries information center is says:

SQL0104 SQLCODE -104 SQLSTATE 42601

Explanation: Token &1 was not valid. Valid tokens: &2.

1
  • Are you deleting your comments?
    – AngocA
    Commented Sep 2, 2014 at 14:53

2 Answers 2

1

It appears that I wasn't given the right permissions to execute the stored procedure. SQL0551N This link explains more about the issue.

0

The statement terminator in SQuirreL is called "Statement separator" and it can be defined in:

Menu Session > Session Properties... > tab SQL > at the end of the SQL square, the option Statement Separator.

enter image description here

This is valid in version 3.5.3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.