Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2001
    Location
    Finland, Kirkkonummi
    Posts
    17

    Unanswered: Problem with overloaded SQL procedures

    Hello

    I first posted this to Usenet news a bit over week ago but no one seems to comment the problem there. So I'll try again here hopefully with better luck. Feel free to ask more details.

    I am running a DB2 UDB v7.2 fp 7 on Windows 2000.

    For some reason I can no longer use overloaded procedures.
    For example if I create following procedures:

    CREATE PROCEDURE Proc1 (
    ID INT)
    LANGUAGE SQL
    RESULT SETS 1
    P1: BEGIN
    DECLARE c1 CURSOR WITH RETURN FOR
    SELECT CHAR(ID) FROM SYSIBM.SYSDUMMY1;
    OPEN c1;
    END P1

    CREATE PROCEDURE Proc1 (
    ID INT, ID2 INT)
    LANGUAGE SQL
    P1: BEGIN
    DECLARE c1 CURSOR WITH RETURN FOR
    SELECT CHAR(ID) || CHAR(ID2) FROM SYSIBM.SYSDUMMY1;
    OPEN c1;
    END P1

    Procedures are created without any errors as they should be.
    But if I try to run them at CLP I get following:
    db2 call proc1(1)
    CLI0150E Driver not capable. SQLSTATE=HYC00

    db2 call proc1(2,1)
    CLI0150E Driver not capable. SQLSTATE=HYC00

    The weird part is that they run smoothly if I run them from Stored Procedure Builder.

    This same problem seems to occur at fp6 also.


    Thank you for your replies,

    Vesku

  2. #2
    Join Date
    Feb 2002
    Location
    Germany
    Posts
    141

    Re: Problem with overloaded SQL procedures

    Did you try to call the sp from a programm?

    SQL Reference:

    "This statement can only be embedded in an application program. It is an executable statement that cannot be dynamically prepared".

    CLP uses dynamic SQL, so, you can call it this way.

    HTH,
    Rodney Krick

  3. #3
    Join Date
    Nov 2001
    Location
    Finland, Kirkkonummi
    Posts
    17
    Hello,

    Thank you for the reply.
    All our calls are dynamic so that does not help much.

    The weird thing is that it worked earlier (I recall it working in fp 2 at least) . I do now know which fix pack broke the call / changed calling style.

    Vesku

Posting Permissions

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