Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2012
    Posts
    7

    Unanswered: Problem while exceuting the stored procedure in db2 (TOAD 4.7)

    Iam getting this error while executing this procedure in db2 toad 4.7..

    ERROR [42601] [IBM][DB2] SQL0104N An unexpected token "<END-OF-STATEMENT>" was found following "". Expected tokens may include: "( <IDENTIFIER> XMLTABLE TABLE FINAL OLD". SQLSTATE=42601

    Procedure as below...

    BEGIN
    DECLARE getProduct CHAR(20);
    DECLARE c1 CURSOR WITH RETURN FOR s1;


    SET getProduct = 'SELECT PRODUCT FROM TEXC_TS_DEFINE_NO';


    PREPARE s1 FROM getProduct;
    OPEN c1;
    END;


    What need to be done to resolve this..

    Thanks in advance

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    having a look at previous entries :
    do not forget the statement terminator : by default ;
    should be changed to other character.....
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Oct 2012
    Posts
    7
    Actually I have given the statement termination character but im getting still the same error.Is there any where i need to change any properties in TOAD 4.7 for db2.

    I saw one thing -t flag.

    how to use it i didn't understood..

    Could you please tell me..

    Thanks in advance

  4. #4
    Join Date
    Oct 2012
    Posts
    7
    Which character I need to give other than statement termination cahracter..
    Could you please tell

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    have a look at the doc
    Command line processor options
    all options are documented and explained
    any other termination character will do that is not used in sp : usually @
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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