db2 create table through the result set

If you want to create a table by the result set, you can use "create table as (select * from table_name) definition only" statement.

Now we open a new window DB2CLP, issue "CONNECT TO SAMPLE" command, even on the sample database SAMPLE, and then issued a "create table newtest1 as (select * from test1) definition only" command to create the table newtest1, its structure and test1 identical specific as shown in Listing 10:

Listing 10. Through the result set to create the table

C: \> db2 connect to sample

Database connection information

Database server = DB2 / NT 9.1.0
SQL authorization ID = RHETTE
Local database alias = SAMPLE

C: \> db2 create table newtest1 as (select * from test1) definition only
DB20000ISQL command completed successfully.

C: \> db2 select * from test1

ID
- - - - - - - - - - - - - - - - - - -
1
1
1
1
1

5 records have been selected.

分类:Database 时间:2010-10-27 人气:146
分享到:
blog comments powered by Disqus

相关文章

  • Comparison of database connection pool 2010-11-03

    Now commonly used are open source data connection pool c3p0, dbcp and proxool three, of which: ¨ hibernate development team recommended c3p0; ¨ spring development team recommended dbcp (dbcp connection pool weblogic connection pool has the same problem, t

  • Comparing Java framework database connection pool (c3p0, dbcp and proxool) 2011-07-16

    Now commonly used open source data connection pool are c3p0, dbcp and proxool three, including: ¨ hibernate team recommends using c3p0; ¨ spring team recommends using dbcp (dbcp connection pool weblogic connection pool has the same problem, is forced to c

  • Database connection pool more 2010-11-03

    Now commonly used open source data connection pool are c3p0, dbcp and proxool three, including: ¨ hibernate team recommends using c3p0; ¨ spring team recommends using dbcp (dbcp connection pool weblogic connection pool has the same problem, is forced to c

  • JAVA Database Connection Pool 2009-10-24

    Although using APACHE COMMONS DBCP can be very convenient to establish a database connection pool, However, as this article within the database connection pool principles written in such a thorough look so complete, Is really very rare, so that developers

  • An effect is very nice JAVA database connection pool 2009-08-05

    import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.Driver; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Enumeration; import java.util.Vector; /* Although the use of APA

  • Database connection pool 2010-02-06

    Database Connection Pool overview: Database connection is an expensive key limited resources, this web page in a multi-user applications, especially embodied. The management of the database connection can significantly affect the entire application s ...

  • About the database connection pool 2010-03-07

    Database connection is an expensive key limited resources, this web page in a multi-user applications, especially embodied. The management of the database connection can significantly affect the entire application scalability and robustness to the ap ...

  • From the database connection associated with the five kinds of design patterns 2010-05-29

    Recently looking at design patterns such information. Sudden inspiration, from the database connection to the five kinds of associative design patterns. Then prepared Xia, can achieve, some of the implementations in real production environments was n ...

  • The basic principles of database connection pool 2010-06-11

    Traditional database connection (refer to the basic realization through DriverManager and DataSource to connect), a database connection objects are corresponding to a physical database connection, database connection and the closure of the establishm

  • DBCP database connection pool 2010-06-24

    Concepts: database connection pool for distribution, management and release database connections, it allows applications to reuse an existing database connection, instead of re-establishing a connection; release of free time over the maximum idle tim

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.157 (s). 12 q(s)