Harvinder Singh schrieb:
> 
> Hi,
> 
> I am running couple of ddl statements dynamically....
> problem is whenever oracle is unable to execute particlar
> statement it just exit from procedure and don't go to next
> statement.
> How to modify syntax.........
> 
> Thanks
> Harvinder
> --

Hi,

just catch the exceptions. For example, 

  -- create entries in application schema
  v_cursor := DBMS_SQL.OPEN_CURSOR;
  FOR v_Index IN 1 .. v_ENV.COUNT LOOP    
    -- Drop old database link
    BEGIN
      v_statement := 'DROP DATABASE LINK ' || v_ENV(v_Index).v_env_code;
      DBMS_OUTPUT.PUT_LINE(v_statement);
      DBMS_SQL.PARSE (v_cursor, v_statement, DBMS_SQL.NATIVE);
      v_num_rows := DBMS_SQL.EXECUTE (v_cursor);
    EXCEPTION
      WHEN OTHERS THEN
        IF SQLCODE != -2024 THEN
          RAISE;
        END IF;
    END;
 
I'm trying to drop database links. Since I'm not sure wether they
already exist or not, I just catch exception 2024.
Read the Error Messages Docu to find out about what to catch.

 ----------------------------
| Regards,                   |
| Stefan Jahnke              |
| BOV AG                     |
| @:D2 Vodafone, Abt.: FIBM  |
 ----------------------------
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stefan Jahnke
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to