Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Posts
    8

    Exclamation Unanswered: sample native sql stored procedure db2

    Can I ask a program source code for native sql stored procedure used in db2 zos. I want to have a pattern for the stored procedure. I can't seem to find one in the internet. I only find books for LUW. If it is too much to ask please include the DECLARE, CASE, CALL, IF ELSE statement.

    I really need it badly for I can't see no resources in our office. This is totally new for me and I am clueless.

    Thanks a lot in advance.!!! I know that this is too much. I don't know someone who really knows how to use this language

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    As far as I saw briefly in "DB2 Version 9.1 for z/OS SQL Reference",
    there are very few differences in syntax(except option-list)
    between external SQL stored procedure(traditional) and native SQL stored procedure(new in DB2 9.1 for z/OS).

    One major difference I realized was native SQL stored procedure supports FOR statement.
    It wes not supported on DB2 8 for z/OS.

    External SQL stored procedures are created by specifying (FENCED or EXTERNAL NAME 'string') and LANGUAGE SQL.
    Please see Stolze's post for other differences...
    http://www.dbforums.com/db2/1653708-...edure-db2.html

    For common SQL(including SQL procedural language control statements) across other platforms, see this article...
    The SQL Reference for Cross-Platform Development

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Don't people read manuals any more?

    See Chapter 25 of this manual. You want to look at examples of SQL stored procedures (LANGUAGE SQL).
    http://publib.boulder.ibm.com/epubs/pdf/dsnapj16.pdf

    All the DB2 z/OS Manuals are here:
    IBM DB2 for z/OS - Technical Resources - United States
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Feb 2010
    Posts
    8

    SQL native procedure

    Thank you for all the replies!!! I will start reading those manuals.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Here is a nice redbook going into depths of DB2 z/OS stored procedures: http://www.redbooks.ibm.com/redbooks/pdfs/sg247604.pdf
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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