By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,236 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,236 IT Pros & Developers. It's quick & easy.

db2 store procedures Question

P: n/a
if I have 1000 cobol insructions running in batch, and I have 1000
cobol instructions running in a store procedure, which one will be more
efficient (execute faster) or there is no difference. and in this
questions no db2 sql, simply cobol instructions!!!!

Aug 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Generally, running SQL inside a stored procedure is the fastest way to
process instructions - as the SQL is running inside the database engine
- there is nothing going over wire/tcpip.
Even if you have compiled (external) COBOL Stored Procedures - although
external, they are running right beside the database engine - so will
be faster then an alternative running SQL over wire.
Gary wrote:
if I have 1000 cobol insructions running in batch, and I have 1000
cobol instructions running in a store procedure, which one will be more
efficient (execute faster) or there is no difference. and in this
questions no db2 sql, simply cobol instructions!!!!
Aug 20 '06 #2

P: n/a
The COBOL would run at the same speed, the difference would be in the
overhead of getting to the code. In batch, everytime you execute it, all it
does is a simple branch & link - calling the same code as a stored procedure
would have all the overhead of passing through db2, then getting the results
back etc.

- I had a series of programs that I coded as DB2 functions - which were
called hundreds of thousands of times and they ran real slow. Converting the
application to COBOL batch file processing calling COBOL suboutines made the
whole process run much much faster...

- It really depends on how often you want to call it, and where else you may
want to call it from in the future. As a stored procedure, you can call it
from a java web app - something you can't do with a COBOL subroutine. But
then again if you're only passing back output parameters - the same code
could be called as either a subroutine or a stored procedure.

Bill

"Gary" <gu*****@gmail.comwrote in message
news:11**********************@m79g2000cwm.googlegr oups.com...
if I have 1000 cobol insructions running in batch, and I have 1000
cobol instructions running in a store procedure, which one will be more
efficient (execute faster) or there is no difference. and in this
questions no db2 sql, simply cobol instructions!!!!

Sep 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.