DB2 - L

 View Only
Expand all | Collapse all

BIND ERR

  • 1.  BIND ERR

    Posted Oct 13, 2022 12:25 PM
    Not sure why am I getting (-204) table not found error pointing to a PL/I program with hold cursor using CTE's first table declared. Thanks for checking this.

    ------------------------------
    Venkat Sundar
    ------------------------------


  • 2.  RE: BIND ERR

    Posted Oct 13, 2022 12:32 PM

    Venkat,

     

    I can't speak for anyone else here, but I'd need to look at the SQL used in order to understand the missing object, if it's based on a CTE.

     

    /phil

     

     

    Philip Sevetson

    Computer Systems Manager

    FISA-OPA

    5 Manhattan West

    New York, NY 10001

    psevetson@fisa-opa.nyc.gov

    917-991-7052 m

    212-857-1659 f

    image001.png@01D261E4.BE68E970

     






  • 3.  RE: BIND ERR

    Posted Oct 13, 2022 12:41 PM
    Hi,
    Can you sent the SQL ?
    Greetings
    Patrick Steurs 





  • 4.  RE: BIND ERR

    Posted Oct 13, 2022 01:06 PM
    Normally it is caused by the wrong OWNER in the BIND...

    Roy Boxwell 


    SOFTWARE ENGINEERING GmbH and SEGUS Inc.
    -Product Development-
     


    IBM Champion 2022


    Vagedesstrasse 19
    40479 Dusseldorf/Germany
    Tel. +49 (0)211 96149-675
    Fax +49 (0)211 96149-32
    Email: 
    R.Boxwell@seg.de
    Web  http://www.seg.de

    Link zur Datenschutzerklärung


    Software Engineering GmbH
    Amtsgericht Düsseldorf, HRB 37894
    Geschäftsführung: Gerhard Schubert, Ulf Heinrich






  • 5.  RE: BIND ERR

    Posted Oct 13, 2022 03:56 PM
    Edited by Venkat Sundar Oct 13, 2022 04:17 PM
    I am using function id as owner.

    Just wanted to make sure, with clause can be used in cursor within a COBOL, PL/I application, right.?

    This is a sample of my CTE type;
    EXEC SQL DECLARE DATE_CURSOR CURSOR WITH HOLD FOR
    WITH PDP
    (CURR_DATE
    ,CURR_MONTH
    ,CURR_YEAR
    )
    AS
    (SELECT
    DATE (CURRENT TIMESTAMP)
    ,MONTH (CURRENT TIMESTAMP)
    ,YEAR(CURRENT TIMESTAMP)
    FROM SYSIBM.SYSDUMMY1)
    SELECT CURR_DATE
    ,CURR_MONTH
    ,CURR_YEAR
    FROM PDP
    ;
    ------------------------------
    Venkat Sundar
    ------------------------------



  • 6.  RE: BIND ERR

    Posted Oct 14, 2022 01:48 AM
    But is the table schema the same as function id??

    Roy Boxwell

    SOFTWARE ENGINEERING GmbH and SEGUS Inc.
    -Product Development-



    Vagedesstrasse 19
    40479 Dusseldorf/Germany
    Tel. +49 (0)211 96149-675
    Fax +49 (0)211 96149-32
    Email: R.Boxwell@seg.de
    Web http://www.seg.de
    Link zur Datenschutzerklärung

    Software Engineering GmbH
    Amtsgericht Düsseldorf, HRB 37894
    Geschäftsführung: Gerhard Schubert, Ulf Heinrich




  • 7.  RE: BIND ERR

    Posted Oct 14, 2022 03:09 AM
    The sample you posted works for me.  I can only presume that in turning your code into a "sample" you destroyed the thing that was causing the problem.  Are you CERTAIN that the two PDP names are, in fact, the same?

    ------------------------------
    James Campbell
    ------------------------------



  • 8.  RE: BIND ERR

    Posted Oct 14, 2022 04:06 AM
    This works fine for me...(Some code removed!)

    EXEC SQL
    DECLARE blah CURSOR WITH HOLD FOR
    WITH SPLITROWS (DBNAME, TSNAME, SPLIT_ROWS)
    AS (SELECT DISTINCT DBNAME, TSNAME, 'Y'
    FROM SE_TABLES
    WHERE SPLIT_ROWS = 'Y')
    SELECT

    Blah blah

    FROM SYSIBM.SYSDATABASE DB
    Blah blah
    LEFT OUTER JOIN
    SPLITROWS TA
    ON TA.DBNAME = DB.NAME
    Blah blah

    FOR READ ONLY
    WITH UR
    END-EXEC



    Roy Boxwell

    SOFTWARE ENGINEERING GmbH and SEGUS Inc.
    -Product Development-



    Vagedesstrasse 19
    40479 Dusseldorf/Germany
    Tel. +49 (0)211 96149-675
    Fax +49 (0)211 96149-32
    Email: R.Boxwell@seg.de
    Web http://www.seg.de
    Link zur Datenschutzerklärung

    Software Engineering GmbH
    Amtsgericht Düsseldorf, HRB 37894
    Geschäftsführung: Gerhard Schubert, Ulf Heinrich




  • 9.  RE: BIND ERR

    Posted Oct 14, 2022 10:36 AM

    Is it possible to share your bind card details ?

     






  • 10.  RE: BIND ERR

    Posted Oct 14, 2022 03:15 AM
    Does the table SGIIWT.PDP exist in Db2?

    ------------------------------
    Jørn Thyssen
    Rocket Software
    2022 IBM Champion
    ------------------------------



  • 11.  RE: BIND ERR

    Posted Oct 14, 2022 11:33 AM
    PDP is a derived table within CTE, it will not have any schema.

    ------------------------------
    Venkat Sundar
    ------------------------------



  • 12.  RE: BIND ERR

    Posted Oct 14, 2022 03:20 PM
    There was a last minute change to include piece of CTE piece within the logic to make a direct SQL call. It had reference to PDP table and that is where the BIND was complaining about! I was relating error to original cursor CTE, which is not the case. Negligence on my part, apologize me. Thanks everyone for looking into this.

    ------------------------------
    Venkat Sundar
    ------------------------------