Table of ContentsPreviousNext

Database Migration


Result Set Conversion from Microsoft SQL Server to IBM DB2

A standalone SELECT statement returns the result set to the client application from a Microsoft SQL Server procedure.

In order to return a result set from a DB2 procedure, you have to declare a cursor with the WITH RETURN option, and open the cursor.

SQLWays converts Microsoft SQL Server standalone SELECT statements to DECLARE WITH RETURN cursors and OPEN statements in IBM DB2.

Example:

TABLE 63. Result Set Conversion from Microsoft SQL Server to IBM DB2
Microsoft SQL Server
IBM DB2

create procedure SalesOrder_Test
as
begin
select * from Customers
end

create procedure SalesOrder_Test ( )
LANGUAGE SQL
DYNAMIC RESULT SETS 1
begin
DECLARE cur1 CURSOR WITH RETURN
FOR select * from Customer s;
open cur1;
end


Ispirer Systems
http://www.ispirer.com
ispirer@ispirer.com
Table of ContentsPreviousNext