Friday, March 23, 2012

Executing a store procedure

Hi,

I Have the next problem:

I have a store procedure in my db which is called from an aplication (developed in Java). That sp contains a cursor which updates regs from a table. After calling from the java application I notice that some regs of the cursor have not entered in it, i mean if the sp executes 200 iterations in the cursor only 150 have worked. But all the iterations enter when i call the sp from the query analyzer!!! and it takes more time too.

Does anybody know something about it???Hi,

I Have the next problem:

I have a store procedure in my db which is called from an aplication (developed in Java). That sp contains a cursor which updates regs from a table. After calling from the java application I notice that some regs of the cursor have not entered in it, i mean if the sp executes 200 iterations in the cursor only 150 have worked. But all the iterations enter when i call the sp from the query analyzer!!! and it takes more time too.

Does anybody know something about it???

I've never heard of Java having this effect on anything and find it rather hard to believe. Have you tried running profiler and seeing what calls are being made. You should do this and compare the results of one being ran in QA and one being ran with your Java Application.

Also, you should really get rid of the cursor. Look on SQLTeam.com (search the forums) for cursors. You will find many set-based and while loop methods to avoid using a cursor.

No comments:

Post a Comment