INSERT VALUES IN PARENT TABLES WITH SQL LOADER [message #187059] |
Thu, 10 August 2006 13:09  |
superoscarin@hotmail.com
Messages: 101 Registered: July 2006 Location: Mexico
|
Senior Member |

|
|
Hi: 2 questions
I have a control file that load table_B and is child of table_A
Are there any way to specify that load a specific data in table_A, when i try to insert many data in table_B and they don't exist in table_a?
Example:
Table_A
id1 desc
------------
1 desc1
2 desc2
Table_B
id2 id1 value
--------------
a 1 value1
b 2 value2
c 3 value3-->and insert 3 in Table_A.id1 or any other value.
And a second question... Do you know how insert a value when in my text file don't exist any value.
For example;
1,2,''--> if the file value doesn't exist, insert a value in the table (9 for example)... In this case should insert 9 for the last field.
but if exists insert the text file value.
2,3,'4' --> in this case insert 4.
Could you give me some reference documentation about it?? I'm reading oracle database utilities but i still haven´t found something...
Thank you to all.
Alex
|
|
|
Re: INSERT VALUES IN PARENT TABLES WITH SQL LOADER [message #188189 is a reply to message #187059] |
Thu, 17 August 2006 07:05  |
nmacdannald
Messages: 460 Registered: July 2005 Location: Stockton, California - US...
|
Senior Member |
|
|
>Are there any way to specify that load a specific data in >table_A, when i try to insert many data in table_B and they >don't exist in table_a?
Use the a trigger to insert some data into the parent table? What is the point of mandating rows exits in table A if you are just going to create the row anyway? Perhaps you need to take off the exists constraint from tabel B?
>And a second question... Do you know how insert a value when >in my text file don't exist any value.
Use the default value clause.
|
|
|