INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Created DB2 proc. I cannot see the problem with this

Created DB2 proc. I cannot see the problem with this

Created DB2 proc. I cannot see the problem with this

(OP)
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


RE: Created DB2 proc. I cannot see the problem with this

(OP)
Forgot the first time Version is 9.7

RE: Created DB2 proc. I cannot see the problem with this

(OP)
After additional reading, I was able to determine my problem which was not related to syntax but instead to not having studied db2 enough to understand differences with SQL Server and/or Oeacle on creating procedures

RE: Created DB2 proc. I cannot see the problem with this

Thank you for posting what you found.

Do be aware that neither SQL Server nor Oracle are DB2.

RE: Created DB2 proc. I cannot see the problem with this

(OP)
Papadba,
I found that out I must admit. I underestimated the challenge and over estimated my knowledge a bit bigsmile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close