what is External tables? explain with examples

Answers were Sorted based on User's Feedback



what is External tables? explain with examples..

Answer / jayaprakash gutti

External table is a complement to SQl* Loader.
External table is more faster compared to SQL loader when
there is thousands of records in source data file.

When we create External table, a link is established between
external table and source data file (which is located in the
file system/Oracle Server).

whenever we query external table like:

select * from external_table;

it fetches data from the file and displayed.
also, external tables are read-only.
you can't perform DML operations.

we can insert the data in the external table to any of the
data base table we want.

Is This Answer Correct ?    3 Yes 0 No

what is External tables? explain with examples..

Answer / 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

More SQL PLSQL Interview Questions

what are the demerits of sql?

1 Answers  


How many types of keys are there in sql?

0 Answers  


What are two statement types in sql?

0 Answers  


What is dynamic query?

0 Answers  


What is difference between db2 and sql?

0 Answers  






How do I view a table in sql?

0 Answers  


What is the size of partition table?

0 Answers  


what is primary key? : Sql dba

0 Answers  


Explain mutating table error.

0 Answers  


What is number function in sql?

0 Answers  


How do you go back in sql?

0 Answers  


i have a customer table. trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output. trans_id trans_amt debit_credit_indicator i want get highest credit amount and lowest credit amount and highest debit amount and lowest debit amount for each trans_id. pls give me answer. i want urgent

3 Answers  


Categories