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.deWeb
http://www.seg.deLink zur Datenschutzerklärung
Software Engineering GmbH
Amtsgericht Düsseldorf, HRB 37894
Geschäftsführung: Gerhard Schubert, Ulf Heinrich
Original Message:
Sent: 10/14/2022 3:09:00 AM
From: James Campbell
Subject: RE: BIND ERR
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
------------------------------
Original Message:
Sent: Oct 13, 2022 03:56 PM
From: Venkat Sundar
Subject: BIND ERR
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
Original Message:
Sent: Oct 13, 2022 01:06 PM
From: Roy Boxwell
Subject: BIND ERR
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
Original Message:
Sent: 10/13/2022 12:25:00 PM
From: Venkat Sundar
Subject: BIND ERR
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
------------------------------