Hi,

I don't know, it works for me:

  create schema db1;
  create schema db2;
  create table db1.table(id int);
  CREATE TABLE db2.table AS SELECT * FROM db1.table;
  select * from db2.table;

Regards,
Thomas

On Thursday, October 30, 2014, Venkata siva kamesh Bhallamudi <
[email protected]> wrote:

> Hi All,
>  I want to copy all the tables, along with the data, from one database
> into another database. I have used CTAS  and issued the following command
>
>                                     *CREATE TABLE db2.table AS SELECT *
> FROM db1.table*
>
> In the above case, *db2 *is an in-memory database and db1 is an disk
> database.  Also, both the databases exist. However, it failed with the
> following exception
>
> org.h2.jdbc.JdbcSQLException: Schema "*db2*" not found; SQL statement:|*CREATE
> TABLE db2.table AS SELECT * FROM db1.table* [90079-181]
> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
> at org.h2.message.DbException.get(DbException.java:179)
> at org.h2.message.DbException.get(DbException.java:155)
> at org.h2.command.Parser.getSchema(Parser.java:656)
> at org.h2.command.Parser.getSchema(Parser.java:663)
>
> Please help me, whether H2 supports above CTAS?. If so, please help me how
> to do it?
>
> --
> Kamesh
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');>
> .
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to