thendrickson
Programmer
I have little experience with db2 and am trying to create a new procedure by following the example and modifying it to fit my needs I found on IBM's web site
I cannnot see the problem with this
The first error shows at "Begin" and I have noted the errors shown with the addition of the comment symbols if you want to paste this into an editor.
I have examined this and compared it to everything I have found so far and do not see my error so I would appreciate any body who can point out my error
Thanks
CREATE PROCEDURE RPT.rpt_CR_NCS0436B ()DYNAMIC RESULT SETS 1
P1: BEGIN --error shows as; DB2 for Linux, UNIX, and Windows: "END" was expected to form a complete scope.
DECLARE cursor1 CURSOR WITH RETURN for --DB2 for Linux, UNIX, and Windows: "<psm_semicolon>" was expected to form a complete scope.
-- #######################################################################
-- ######################################################################
SELECT
CALLMST.CACMPNY,
CLMDTL.CDCMPNY,
CLMEXCLDTL.CECLMDT
FROM TESTSCHEMA.CALLMST CALLMST
INNER JOIN TESTSCHEMA.CLMDTL CLMDTL
ON CALLMST.CACMPNY=CLMDTL.CDCMPNY
AND CALLMST.CADIV=CLMDTL.CDDIV
INNER JOIN TESTSCHEMA.CLMEXCLDTL CLMEXCLDTL
ON CLMDTL.CDCLMDT=CLMEXCLDTL.CECLMDT
AND CLMDTL.CDCLMSEQ=CLMEXCLDTL.CECLMSEQ
AND CLMDTL.CDCLMSFX=CLMEXCLDTL.CECLMSFX
AND CLMDTL.CDSRVLN=CLMEXCLDTL.CESRVLN;
-- Cursor left open for client application
OPEN cursor1; --DB2 for Linux, UNIX, and Windows: "<join_type_without_spec> JOIN <join_operand>" was expected to form a complete scope.
END P1 -- Multiple markers at this line
- DB2 for Linux, UNIX, and Windows: "JOIN <joined_table>" was expected to form a complete scope.
- DB2 for Linux, UNIX, and Windows: "<join_spec>" was expected after "P1".
I also tried it with the statement terminator added to the last line END P1; which generated -- DB2 for Linux, UNIX, and Windows: "<join_type_without_spec> JOIN <join_operand>" was expected to form a complete scope. as the last error leaving the previous errors the same
I cannnot see the problem with this
The first error shows at "Begin" and I have noted the errors shown with the addition of the comment symbols if you want to paste this into an editor.
I have examined this and compared it to everything I have found so far and do not see my error so I would appreciate any body who can point out my error
Thanks
CREATE PROCEDURE RPT.rpt_CR_NCS0436B ()DYNAMIC RESULT SETS 1
P1: BEGIN --error shows as; DB2 for Linux, UNIX, and Windows: "END" was expected to form a complete scope.
DECLARE cursor1 CURSOR WITH RETURN for --DB2 for Linux, UNIX, and Windows: "<psm_semicolon>" was expected to form a complete scope.
-- #######################################################################
-- ######################################################################
SELECT
CALLMST.CACMPNY,
CLMDTL.CDCMPNY,
CLMEXCLDTL.CECLMDT
FROM TESTSCHEMA.CALLMST CALLMST
INNER JOIN TESTSCHEMA.CLMDTL CLMDTL
ON CALLMST.CACMPNY=CLMDTL.CDCMPNY
AND CALLMST.CADIV=CLMDTL.CDDIV
INNER JOIN TESTSCHEMA.CLMEXCLDTL CLMEXCLDTL
ON CLMDTL.CDCLMDT=CLMEXCLDTL.CECLMDT
AND CLMDTL.CDCLMSEQ=CLMEXCLDTL.CECLMSEQ
AND CLMDTL.CDCLMSFX=CLMEXCLDTL.CECLMSFX
AND CLMDTL.CDSRVLN=CLMEXCLDTL.CESRVLN;
-- Cursor left open for client application
OPEN cursor1; --DB2 for Linux, UNIX, and Windows: "<join_type_without_spec> JOIN <join_operand>" was expected to form a complete scope.
END P1 -- Multiple markers at this line
- DB2 for Linux, UNIX, and Windows: "JOIN <joined_table>" was expected to form a complete scope.
- DB2 for Linux, UNIX, and Windows: "<join_spec>" was expected after "P1".
I also tried it with the statement terminator added to the last line END P1; which generated -- DB2 for Linux, UNIX, and Windows: "<join_type_without_spec> JOIN <join_operand>" was expected to form a complete scope. as the last error leaving the previous errors the same