Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2010
    Posts
    40

    Unanswered: Second Cursor not inserting the Data.

    Hello All,
    I am working on a stored procedure to insert data into two tables.I have written a stored procedure with two cursors for that.Problem is when I call the procedure data is successfully inserted into the first table but the second table is still empty.

    The only link between the two cursors is first cursor inserts data into a table and the second cursor reads the same data.

    can some one help me with this.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You need to set NOT_FOUND to 'N' after the loop for the first cursor. When the first cursor hit the end, you condition handler is setting NOT_FOUND = 'Y', which will exit the loop. You use the same check for the second loop,k but you never reset NOT_FOUND which is now 'Y'.

    Andy

  3. #3
    Join Date
    Aug 2010
    Posts
    40
    Quote Originally Posted by ARWinner View Post
    You need to set NOT_FOUND to 'N' after the loop for the first cursor. When the first cursor hit the end, you condition handler is setting NOT_FOUND = 'Y', which will exit the loop. You use the same check for the second loop,k but you never reset NOT_FOUND which is now 'Y'.

    Andy
    Thanks that helped.

Posting Permissions

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