Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is External tables? explain with examples

Answer Posted / karkuvelrajan muthusamy

External tables can be used to fetch data from a physical
data file present in the OS path of the database server.. It
is similar to SQL*Loader where oracle reads data from a
datafile and loads into oracle tables.. An external table is
very similar.. Whenever we create an eternal table, oracle
doesnot load data from file instead a table that referes to
the file only is created.. A sample syntax could be as
following:

create table ext_tbl
(e_name varchar2(50),
e_sal number)
ORGANIZATION EXTERNAL(
TYPE ORACLE_LOADER
-- Default->ORACLE_LOADER, Oracle_datapump can also be used
DEFAULT DIRECTORY ext_dir
-- An oracle directory has to be created with
-- name ext_dir
ACCESS PARAMETERS
(
FIELDS TERMINATED BY ','
RECORDS DELIMITED BY NEWLINE
MISSING FIELD VALUES ARE NULL
(e_name, e_sal)
)
LOCATION('file1.txt')
)

The file1.txt should be in the following format:
Kumar,20000
Raj,10000
Patel,34000

Hope this helps.

Regards,
Karkuvelrajan M

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between group by and partition by?

1048


What is the difference between a subquery and a join?

1089


what is table? : Sql dba

1049


When is the explicit cursor used ?

1023


What is the basic structure of an sql?

1094


Is there any restriction on the use of union in embedded sql?

1150


How do you update f as m and m as f from the below table testtable?

1843


How do I debug a stored procedure?

1103


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1201


What is an oracle stored procedure?

1039


define sql update statement ? : Sql dba

1109


What is a table partition?

1119


How do I remove duplicates in two columns?

1047


Is delete faster than truncate?

1002


Why is partition used in sql?

1112