Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Congratulations for your great site. This site helped me more than university..."

Geography

Where in the world do Tek-Tips members come from?

Question about Sql Procedure

aaajjj (Programmer)
21 Dec 00 11:42
I have Db2 7.1 and the following script I try to execute

CREATE PROCEDURE aaww()
BEGIN
DECLARE i INTEGER DEFAULT 1;
ins_loop:
LOOP IF i>100 THEN
LEAVE ins_loop;
ELSEIF i<=100 THEN
ITERATE ins_loop;
END IF;
INSERT INTO TAB1 VALUES (i,'FIRST VALUES');
SET i = i + 1;
END LOOP;
END@

and getting error
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "BEGIN" was found following "ATE PROCEDURE  aaww()".  Expected tokens may include:  "<proc_attribute_list>".  LINE  NUMBER=1.  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "i" was found following "DECLARE ".  Expected  tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token ": LOOP IF i>100 THEN LEAVE ins_loop;" was found  following "ins_loop".  Expected tokens may include:  "<space>".   SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "i" was found following "ELSEIF ".  Expected  tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "IF" was found following "END ".  Expected  tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token ";" was found following "S (I,'FIRST VALUES')".   Expected tokens may include:  "END-OF-STATEMENT".  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0206N  "I" is not valid in the context where it is used.  SQLSTATE=42703
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "LOOP" was found following "END ".  Expected  tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601
DB21034E  The command was processed as an SQL statement because it was not a  valid Command Line Processor command.  During SQL processing it returned: SQL0104N  An unexpected token "END-OF-STATEMENT" was found following "END@".   Expected tokens may include:  "JOIN <joined_table>".  SQLSTATE=42601

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close