Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    16

    Unanswered: 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?????

  2. #2
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Quote Originally Posted by efl00002
    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.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •