Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778

    Unanswered: Inserting into (table with trigger)

    Hey,

    I need to insert data into a table that has a trigger constarint on it, there are 100 + rows of which the trigger raises an exception on < 10 of them. The problem is that no row is being inserted.

    insert into t.value1, t.value2
    select a.value2, a.value2
    from temp a

    trigger is on table t.

  2. #2
    Join Date
    May 2003
    Posts
    87
    You could write a pl/sql cursor to loop thru each row and insert into the table. Something like this:

    Code:
    begin
      for c_rec in (select value2 from temp) loop
        begin
          insert into t(value1, value2)
            values(c_rec.value2, c_rec.value2);
        exception
          when others then
            dbms_output.put_line('error:');
        end;
      end loop;
    end;
    /

Posting Permissions

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