how to keep certain columns in a table when import?

Have a need that only want to import  a few columns to a table and leave the other columns in the table untouched. Is it possible with impdp? For example,
Have a table T with 3 columns as follows:
T
---------
col1 col2 col3

Want to import only columns col1 and col2 and keep col3 untouched.
If impdp can not do that, is there any better way to achieve it?

jl66Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
ajexpertCommented:
To my knowledge, impdp may not work with selective columns

However, if you export the data in flat file, you can make use of SQL LOADER

0
 
jl66Author Commented:
Thanks a lot for the info. Do any gurus have different opinion from ajexpert's conclusion?
0
 
Javier MoralesOracle DBACommented:
The way to export selective columns to a flat file is using UTL_FILE pl/sql package.
or generating a spool file with the only two columns you need, even create a html file with the results easely

SQL> set markup html on
SQL> set echo off            
<br>
SQL&gt; spool html_report.html
<br>
SQL&gt; select sysdate from dual;
<br>
<p>
<table border='1' width='90%' align='center' summary='Script output'>
<tr>
<th scope="col">
SYSDATE
</th>
</tr>
<tr>
<td>
13-OCT-11
</td>
</tr>
</table>
<p>

SQL&gt; spool off
<br>
SQL&gt; set markup html off
<br>

Open in new window


0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
JacobfwCommented:
"keep col3 untouched" could mean that you wish to leave this column NULL or do you mean that there is existing data in col3 that needs to match with the new data being added to col1 and col2.

In this case, using a temporary table to import col1 and col2 and then some PL/SQL routine that updates the col1 and col2 of your table doing the appropriate update on the rows with matching col3 (whatever that criteria is).
0
 
jl66Author Commented:
Thanks a lot.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.