db2>drop table itsotable1
db2>create table itsotable1 as
(select * from temp)
definition only not logged initially
db2>insert into itsotable1 select * from temp
db2>drop table temp
Drop table
Tables can easily be deleted from database by issuing drop table statements as
shown below.
For MySQL:
DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name,...] [RESTRICT |
CASCADE]
For DB2 UDB:
DROP table tbname
Non persistent storage tables
Apart from the storage engines discussed above MySQL and DB2 support, here
are some temporary or intermediate table types.
MERGE table
A merge table is a collection of identical MyISAM tables that can be used as
one. You can only select, delete, and update from the collection of the tables,
and dropping the merge table leads to drop the merge specification.
Tables can be merged only if they have identical columns, key information,
and the packing. Example 5 8 shows the statements for merge table in
MySQL.
Example 5 8 Usage of merge table in MySQL
mysql>create table itsotable1
(col1 int not null auto_increament primary key, col2 char(20));
mysql>create table itsotable2(col1 int not null auto_increament primary key,
col2 char(20));
mysql>create table itsomerge
(col1 int not null auto_increament, col2 char(20), key(col1));
TYPE=MERGE UNION=(itsotable1,itsotable2) INSERT_METHOD=LAST;
Chapter 5. Database porting
103
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved