Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    6

    Unanswered: Problems in creating the procedure in Db2

    Hi all,
    I am trying to convert the Oracle procedures to Db2. For that I am using Swiss SQL tool. By using this tool i generted a DB2 script from Oracle Procedure.

    That script is

    DROP PROCEDURE addtuple
    @

    CREATE PROCEDURE addtuple
    (
    IN i FLOAT )
    LANGUAGE SQL
    p1: BEGIN
    INSERT INTO t2
    VALUES ( i ,
    'abc' )
    ;

    END p1
    @

    But when i am trying to executed this procedure in Db2 database, it is throwing the error as below

    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 p1".
    Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601

    SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END p1". Expected tokens may include: "JOIN <joined_table> ".

    Please help me what i have to do to resolve this problem.

    It is urgent for me...., i am waiting for the reply

    Thanks in advance

    Mahi

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    I presume this was coded to a file and executed with
    db2 -td@ -vf filename <---- specify delimiter @ otherwise ; is default
    I tried the same scenario and this worked.
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Do you have some characters after the '@' on the line? Have a look at it with a hex-Editor. The usual problem is that people edit files on Windows, transfer them as binary to Unix, and then have the wrong end-of-line characters. Transfer it as ASCII instead.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •