Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
User asked if external tables can be read like normal tables. Luis Marques explained that external tables have operational restrictions per IBM documentation. Eric Vercelletto clarified that external tables support SELECT statements with WHERE clauses, but don't support indexes, UPDATE, or DELETE operations. INSERT replaces entire file contents.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
SERGIO PERES — — source: IIUG Forums & Mailing Lists
Hi,
How can I read one external table as an usual table, is it possible?
Can I do select from one external table created by another program?
As I only have seen operations over external table after create...???
Thanks for any help,
SP
↪ replying to SERGIO PERES
LUIS MARQUES — — source: IIUG Forums & Mailing Lists
There are restrictions to operations can be done on EXTERNAL TABLES. Check the
online documentation for more details:
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqls.doc/id
s_sqs_2071.htm
You can define an EXTERNAL TABLE and then have an external program modify the
data file . For example, you can define an EXTERNAL TABLE once for a daily
bulk load, and everyday you smash the table data file with a new content. It
is one of the ways to load unload data into the database from flat files.
↪ replying to LUIS MARQUES
SERGIO PERES — — source: IIUG Forums & Mailing Lists
Thanks for your reply,
I itend to use it as temporary unload for query and after read it as a normal
table, but seems that I can't do it! Is this correct?
↪ replying to LUIS MARQUES
SERGIO PERES — — source: IIUG Forums & Mailing Lists
Thanks for your reply,
I itend to use it as temporary unload for query and after read it as a normal
table, but seems that I can't do it! Is this correct?
↪ replying to SERGIO PERES
LUIS MARQUES — — source: IIUG Forums & Mailing Lists
An EXTERNAL table is a permanent object in the database. Other sessions, if
they have the proper permissions, can read and insert into it. Every insert
into the external table will truncate the table ( it will truncate the files
that support the external table ) and replace it's contents.
Check the online documentation. There are several examples that might be
helpful:
https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.sqls.doc/id
s_sqs_2068.htm
Sergio,
an external table is seen as a table in IDS, the difference is that it is no
installed in the dbspace but in files out of the dbspaces.
You can use any SELECT statement even with where clauses, but you are not
entitled to create indexes for an external table.
you can INSERT INTO an external table, but it has to be the full file or
directory contents you declared in the table schema. YOu cannot INSERT rows
one by one.
You cannot UPDATE no DELETE rows from an external table.
Having indexes on external tables would be a good thing when you handle
enormous files :-)
Something to consider: use of external tables is way faster that load and
unload SQL statements. This is true for unloading data (INSERT INTO ext_table
SELECT xxx xxx FROM real_table), and also for importing data (INSERT INTO
real_table SELECT *** (WHERE xxx) from ext_table.
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.