|
Scott, DB2 UDB for iSeries supports returning multiple result sets but what you've shown will not work with DB2 since it doesn't look like standard SQL syntax. Syntax you've shown looks simpler for sure, but IBM's committed to sticking with standards. Checkout these two links for examples how to do it. It's actually pretty easy. http://tinyurl.com/prmak http://tinyurl.com/ms6jt And finally, I strongly recommend your .NET developer downloads redbook "Stored Procedures, Triggers and User Defined Functions on DB2 Universal Database for iSeries" available at this link: http://www.redbooks.ibm.com/abstracts/SG246503.html?Open I find it very useful. Good luck with your project. Elvis -----Original Message----- Subject: Translating SQL Server stored procedure to DB2 stored procedure Below is an example of a SQL Server 2000 stored procedure that we use in a query tool that we built for one of our web-based Wintel applications. It is called from a C#.NET application. CREATE PROCEDURE dbo.prc_AH_GetReportsList AS select * from ah_objects select ReportID,ObjectID,ReportName,ReportDescription,DateCreated, UserIDCreated,isnull(DateModified,'') as DateModified, isnull(UserIDModified,'') as UserIDModified,Private, UserNameCreated, isnull(UserNameModified,'') as UserNameModified from AH_Reports We now want to extend this query tool so it can access our DB2 databases for our iSeries application using the .NET data provider included with iSeries Access. My .NET developer is asking if a DB2 stored procedure can return data via multiple select statements (as shown above) without the use of record sets? Based on his research so far, it seems like using cursors and multiple records sets is the only way. We are working against a V5R3 server for this project. Thanks. ---------------------- Scott A. Schollenberger
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.