Re: SQL Loader

From: TurkBear <john.greco_at_dot.state.mn.us>
Date: Mon, 25 Aug 2003 14:43:28 -0500
Message-ID: <ekpkkvkgq4vn1asbtp00ptfaatprt9t1ui_at_4ax.com>


Daniel Morgan <damorgan_at_exxesolutions.com> wrote:

>David Scott wrote:
>
>> Sorry, friend, but SQL*Loader does NOT do updates on tables.
>>
>
>> <snipped>
>
>Don't forget the REPLACE syntax.
>
>No everything is INSERT or APPEND.
But .REPLACE deletes all the existing data, it does not update:.



REPLACE
With REPLACE, all rows in the table are deleted and the new data is loaded. The table must be in your schema, or you must have DELETE privilege on the table. Case 4: Loading Combined Physical Records provides an example.

The row deletes cause any delete triggers defined on the table to fire. If DELETE CASCADE has been specified for the table, then the cascaded deletes are carried out. For more information on cascaded deletes, see the information about data integrity in Oracle8i Concepts.

Updating Existing Rows
The REPLACE method is a table replacement, not a replacement of individual rows. SQL*Loader does not update existing records, even if they have null columns. To update existing rows, use the following procedure:

Load your data into a work table.

Use the SQL language UPDATE statement with correlated subqueries.

Drop the work table.

For more information, see the UPDATE statement in Oracle8i SQL Reference.


Received on Mon Aug 25 2003 - 21:43:28 CEST

Original text of this message