The DATABASE statement sets the current database.
>>-DATABASE--dbname--+-----------+--;-------------------------->< '-MODE ANSI-'
Element | Description |
---|---|
dbname | The name of the current database. |
Multiple DATABASE statements can be used. All table names referenced following this statement are associated with the current database.
If the logging mode of the source database is ANSI and default decimal columns are used in the table schemas, then the logging mode of the database must be declared.
In the following example, both the source and target tables reside in the same database dbs.
DATABASE dbs; CREATE TABLE source (...); CREATE TABLE target (...); INSERT INTO target SELECT * from source;
You can use multiple database statements to extract a table from one database into another database.
DATABASE dbs1; CREATE TABLE source (...) IN dbspace1; DATABASE dbs2; CREATE TABLE target (...) IN dbspace2; INSERT INTO dbs2:target SELECT * FROM dbs1:source;Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]