If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > sample native sql stored procedure db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-19-10, 22:50
angeldust03 angeldust03 is offline
Registered User
 
Join Date: Feb 2010
Posts: 8
Exclamation 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
Reply With Quote
  #2 (permalink)  
Old 02-19-10, 23:55
tonkuma tonkuma is online now
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,194
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...
What is native sql procedure in db2 ?

For common SQL(including SQL procedural language control statements) across other platforms, see this article...
The SQL Reference for Cross-Platform Development
Reply With Quote
  #3 (permalink)  
Old 02-20-10, 01:24
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #4 (permalink)  
Old 02-20-10, 03:23
angeldust03 angeldust03 is offline
Registered User
 
Join Date: Feb 2010
Posts: 8
SQL native procedure

Thank you for all the replies!!! I will start reading those manuals.
Reply With Quote
  #5 (permalink)  
Old 02-21-10, 13:29
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On