Home » SQL & PL/SQL » SQL & PL/SQL » Filler / Bound Filler in External tables (oracle 11g)
Filler / Bound Filler in External tables [message #652002] Tue, 31 May 2016 03:04 Go to next message
ORAGENASHOK
Messages: 240
Registered: June 2006
Location: Chennai
Senior Member
I have a file named ( File1.csv) below

Id  Name    Dept 
1   John    D1
2   Philip  D2 


and have a another file named ( File2.csv) below

Id  Name    Dept 
1   Maha    D1
2   Raj     D2 



Now my need to load both file in same external table with additional column to identify which file the records comes from.


Id   varchar2(100),
Name varchar2(100),
Dept varchar2(100),
Tab  varchar2(100) ( Here i need to give "Tab1" if its comes from file1 as same as "Tab2" if from file2)



Can help on this tricky situations.


[Updated on: Tue, 31 May 2016 03:08]

Report message to a moderator

Re: Filler / Bound Filler in External tables [message #652025 is a reply to message #652002] Tue, 31 May 2016 07:25 Go to previous messageGo to next message
ricky_s
Messages: 21
Registered: February 2016
Location: New Delhi, India
Junior Member
try the below link, it covers the same topic

https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3015912000346648463
Re: Filler / Bound Filler in External tables [message #652032 is a reply to message #652025] Tue, 31 May 2016 08:28 Go to previous message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
depending on which database version you can easly make 2 external tables. One called tab1 and the second called tab2 and then you have a view as follows

create or replace view my_table as
select Id,Name,Dept,'TAB1' Tab 
from tab1
union all
select Id,Name,Dept,'TAB2' Tab 
from tab2;


However if your database is capable of it use the technique given in the link above.
Previous Topic: Loops
Next Topic: Chinese Characters not display in table
Goto Forum:
  


Current Time: Tue Apr 23 01:26:08 CDT 2024