dbTalk Databases Forums  

Best practice for loading data into relational tables

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Best practice for loading data into relational tables in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #41  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Best practice for loading data into relational tables - 03-19-2008 , 07:59 AM






On Mar 18, 8:51 pm, Anoop <anoopkum... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 18, 4:14 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:



Gints Plivna wrote:
I agree with others that SQLLoader is the way to go. However that
won't help you much with fk errors, unless of course you disable them
in advance. So here you can use intermediatte tables without any FK
logic just load data in them. After succesful loading use insert
into ... select from... And here you can quite easily insert firstly
the very parent rows then children, then grandchildren. Of course
there might be some circular FKses but this is quite unusual case,
then you'd have to either disable a few FKses or make them deferred
and commit only at the very end of insert process when everything is
OK.

Gints Plivna
http://www.gplivna.eu

Or use deferrable constraints which would likely be better than
disabling default immediate constraints.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

thanks so much for the really good suggestions.

I think I got a lot of viable solutions, I did not know about Toad
supporting Excel data natively. The only thing is Toad is a paid
software!
But I think what I am planning to do is a combination of disabling
constraints and using sql*loader to take care of the PK & FK.
Unfortunately I think I have the rare case of circular FK's, but
disabling the constraints seems to be the way to go for now.

I also liked the idea of putting the insert into & insert into (select
from) into a shell script with debugging info (just echo). I am pretty
adept at shell scripts & awk so it looks attractive, but at the same
time it is a lot of unncessary code and I think the sql*loader option
is equally easy to do.

Thanks to all and really appreciate the solutions suggested by each of
you.

Anoop
It is nice to see responses to our answers so we know whether we
helped or hindered progress. Thank you for the feedback.
Ed


Reply With Quote
  #42  
Old   
Gints Plivna
 
Posts: n/a

Default Re: Best practice for loading data into relational tables - 03-19-2008 , 04:00 PM






On 18 Marts, 22:14, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Gints Plivna wrote:
then you'd have to either disable a few FKses or make them deferred
and commit only at the very end of insert process when everything is
OK.

Or use deferrable constraints which would likely be better than
disabling default immediate constraints.
--
Hmmm guess where is the difference? Yes - you got it right, there
isnt!

Gints Plivna
http://www.gplivna.eu


Reply With Quote
  #43  
Old   
Gints Plivna
 
Posts: n/a

Default Re: Best practice for loading data into relational tables - 03-19-2008 , 04:00 PM



On 18 Marts, 22:14, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Gints Plivna wrote:
then you'd have to either disable a few FKses or make them deferred
and commit only at the very end of insert process when everything is
OK.

Or use deferrable constraints which would likely be better than
disabling default immediate constraints.
--
Hmmm guess where is the difference? Yes - you got it right, there
isnt!

Gints Plivna
http://www.gplivna.eu


Reply With Quote
  #44  
Old   
Gints Plivna
 
Posts: n/a

Default Re: Best practice for loading data into relational tables - 03-19-2008 , 04:00 PM



On 18 Marts, 22:14, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Gints Plivna wrote:
then you'd have to either disable a few FKses or make them deferred
and commit only at the very end of insert process when everything is
OK.

Or use deferrable constraints which would likely be better than
disabling default immediate constraints.
--
Hmmm guess where is the difference? Yes - you got it right, there
isnt!

Gints Plivna
http://www.gplivna.eu


Reply With Quote
  #45  
Old   
Gints Plivna
 
Posts: n/a

Default Re: Best practice for loading data into relational tables - 03-19-2008 , 04:00 PM



On 18 Marts, 22:14, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Gints Plivna wrote:
then you'd have to either disable a few FKses or make them deferred
and commit only at the very end of insert process when everything is
OK.

Or use deferrable constraints which would likely be better than
disabling default immediate constraints.
--
Hmmm guess where is the difference? Yes - you got it right, there
isnt!

Gints Plivna
http://www.gplivna.eu


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.