0

I know that in oracle the is a way to write to ignore the dupkey, something like

/*+ ignore_row_on_dupkey_index(tab, index_tab) */

Is there a way to do the same thing but with unix commands? I think there's a way with WHENEVER SQLERROR EXIT SQL.SQLCODE but i'm not sure and i don't know how do it. Thanks

Jeffrey Kemp
  • 59,135
  • 14
  • 106
  • 158
Atlas91
  • 5,754
  • 17
  • 69
  • 141
  • Is the data in a file, one date per line? – wolφi Jun 13 '13 at 09:32
  • yes there is. I'm making an insert from a file. But this insert is dynamic and is in more tabs so i can't write the `ignore_row_on_dupkey_index` command. I need something in unix code. – Atlas91 Jun 13 '13 at 09:35
  • Can you remove the duplicated rows from the file, f.i. with `sort -u`? – wolφi Jun 13 '13 at 09:38
  • Sorry maybe i've been not clear. I mean "if during the insert there are some duplicate records ignore and go on". Understand now? – Atlas91 Jun 13 '13 at 09:47
  • 1) Can you temporarily disable indexes, remove constraint and load the data? 2) You can create and external table without any constraints, after the load insert into the target table. – the_slk Jun 13 '13 at 10:59
  • So you are looking for a solution in SQL or SQL*Plus? How about `MERGE` instead of `INSERT`? – wolφi Jun 13 '13 at 11:05
  • Looking for SQL*Plus solution. Mmh how can i use `MERGE`? – Atlas91 Jun 13 '13 at 11:59

0 Answers0