#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    63
    Rep Power
    10

    Question How to exit a procedure


    Hi,
    Suppose have the following condition in my procedure :

    IF var_count = 0 then

    'stop processing' --EXIT PROCEDURE
    ELSE

    'continue processing'

    END IF;

    How do I stop futher processing if var_count= 0 . I think about raising an exception...but is there another way out..like a command 'exit' to stop further processing ?

    Thx...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,784
    Rep Power
    348
    why not simply
    Code:
    IF var_count <> 0 THEN 
    -- process stuff 
    END IF;
    But if you prefer the more complicated way, you can use the return statement
    Code:
    IF var_count = 0 THEN 
      RETURN;
    ELSE
      -- do processing
    END IF;
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    63
    Rep Power
    10
    Thx..pal

    The complicated way suit best my work requirements...

  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    1
    Rep Power
    0
    Originally Posted by shammat
    why not simply
    Code:
    IF var_count <> 0 THEN 
    -- process stuff 
    END IF;
    But if you prefer the more complicated way, you can use the return statement
    Code:
    IF var_count = 0 THEN 
      RETURN;
    ELSE
      -- do processing
    END IF;

    Easy way works fine! Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo