IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What's the significance of Cursor in Stored Procedures


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anu2
Warnings : 1

New User


Joined: 10 Jun 2007
Posts: 36
Location: Chennai

PostPosted: Thu Sep 20, 2007 12:01 pm
Reply with quote

Hi,

How Stored Procedures are different from normal COBOl + DB2 pgm ?
What's the significance of Cursor in Stored Procedures ?

Anu
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Thu Sep 20, 2007 12:24 pm
Reply with quote

2 significant diff's:

1 - inter program communitation. A stored procedure can be called from any other application on any other platform, as long as they have database connection (db2 client or JDBC level 4)
2 - output. output can be represented as parameters (analogy with linkage storage)

or output can be represented as a database-table.
Just imagine a cursor in COBOL: code the SQL in "declare cursor", build the result set with "open cursor" and obtain the rows with "fetch cursor" and clean up your mess with "close cursor".

familiar stuff, right? When you DO NOT code the fetch and close after the open cursor, and just return to the caller by means of "GOBACK" the resulst-set is passed to the caller and can be processed on the client.
Back to top
View user's profile Send private message
akumar

New User


Joined: 12 Jan 2007
Posts: 8
Location: bangalore

PostPosted: Thu Sep 20, 2007 4:49 pm
Reply with quote

one more thing to add on. Stored procedures are helpful in reducing network traffic. In a normal cobol-db2 program if we have 10 sql staments in a cobol-db2 program,there will be 10 I/0 across the network.
but using by stored procedure with some logic we can embbed all the 10 sql in a single sp,and can execute in a single I/o thus reducing the network traffic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts Infosphere Optim - unable to save Col... IBM Tools 0
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
No new posts user exits in Column Map procedures IBM Tools 0
This topic is locked: you cannot edit posts or make replies. Internal Autonomous Stored Procedure ... DB2 6
Search our Forums:

Back to Top