View Single Post

   
  #2 (permalink)  
Old 02-26-2008, 05:36 PM
Knut Stolze
 
Posts: n/a
Default Re: SQL Procedure problem!!!!

Praveen <spraveen2001@yahoo.com> wrote:

> Hi All,
>
> I'm trying to create a simple SQL procedure, But DB2 is giving an
> error..can anyone pls help in this..My proc is something like this and
> stored proc1.db2 file.
>
> CREATE PROCEDURE DB2INST1.Proc1()
> LANGUAGE SQL
> P1: BEGIN
> declare a integer;
> declare b integer;
> declare c integer;
> set c=a+b;
> END P1
>
> when i try to create this using db2 -vf proc1.db2..it says..
> CREATE PROCEDURE DB2INST1.Proc1()

[...]

What do you use as statement terminator? The default is the end-of-line,
which would mean that you have 8 different statements above. You might
want to use some other symbol like an '@':

db2 -td@

db2 =>
db2 => CREATE PROCEDURE DB2INST1.Proc1()
db2 => LANGUAGE SQL
db2 => P1: BEGIN
db2 => declare a integer;
db2 => declare b integer;
db2 => declare c integer;
db2 => set c=a+b;
db2 => END P1
db2 => @


--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Reply With Quote