Results 1 to 3 of 3

Thread: Add another Insert.....

  1. #1
    Join Date
    Mar 2009
    Posts
    3

    Add another Insert.....

    Hi All,

    Could you please let me know where to put Insert statement in following scenario. I have a procedure

    CREATE PROCEDURE...
    variable declaration
    Cursor declaration
    BEGIN
    OPEN cursor
    FETCH...
    IF (condition meet)

    BEGIN

    Insert into X values (xx, xy, xz)

    EXCEPTION
    exception handling;
    END
    END IF

    Close cursor
    end
    Now my doubt is once loading in X table completed successfully(without an error), i need to write a Insert statement { insert into Z values (xx, xz) }. I do not understand where to write this statement, as it should also handle the exception part. Could you please help me on this?

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You can insert into Z immediately after insert into X. If insert into X fails, the exception is executed bypassing Z. If this is not what you want then you may need another procedure.

  3. #3
    Join Date
    Apr 2009
    Posts
    2
    HI,

    Do insert after x, if x fails it will go into the exception so no problem.

    Thanks
    Nani.

Posting Permissions

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