Table of ContentsPreviousNext

Ispirer             Ispirer


Ispirer SQLWays Database Migration Software

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.

TABLE 74. Example of 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  


Table of ContentsPreviousNext
Ispirer             Ispirer
Copyright © 1999-2015 Ispirer Systems Ltd. Ispirer and SQLWays are trademarks of Ispirer Systems Ltd. All other product names may be trademarks of the respective companies. All rights reserved.