Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010

    Question Unanswered: data loading issue

    Hi All,

    Please let me know what is the best way to implement the below conditions:

    i have data in staging table(60lak records & more) and have to insert the data into target table only if all the 1st col records(numeric) in staging table r having +ve values.
    else -ve values need to be inserted into error table. Also if any -ve values are present then all records/data must be deleted from target table(or data shouldnt be loaded into target table).
    what is the best way to do this so tat the performace is not effected...

  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    If this is a daily process and the staging table is identical in terms of setup as the live table, you could use something like Oracle partitions. By creating the staging table with partitions of positive and negative values we can simply move the staging partition of positive values into the live table.

    If there are negative values you can truncate the staging table. This is the most efficient way of removing the records.
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

  3. #3
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    I don't know how data gets into the staging table, but if it is loaded from a file system (using SQL*Loader), then perhaps you could also consider NOT loading data into a staging table at all, but using the file as an external table. If that's the case, a simple procedure could do the rest.

Posting Permissions

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