How to translate other database structure to my H2 Database?

414 views
Skip to first unread message

NotBoos

unread,
Jul 30, 2008, 6:01:13 AM7/30/08
to H2 Database
hi, can I translate data/schema/structure from other database[informix/
oracle/mysql.. and so on.] to my H2 Database? how to do it??

Best Regards

Lee,YB

unread,
Jul 30, 2008, 6:53:14 AM7/30/08
to H2 Database
Hi, I've recently migrated my application database to H2.

I was using SQuirreL SQL Client which have a built-in plugin named DB
Copy, to migrate from MySQL to H2.

Open two different sessions in SQuirrel and find Table tree in Object
tab.
Ctrl-click your table list and right click, select "Copy Table" menu.
Move to next session (H2) and in the table tree, right click and
"Paste Table"

If any problem, off the option "Copy Index definition" in the File/
Global Preference/DB Copy Menu and retry.

lxy

unread,
Jul 30, 2008, 9:18:12 PM7/30/08
to h2-da...@googlegroups.com
I quiet appreciate your answer, maybe I'm not clear describe my prb, actually I want to do this by programming API. Hsqldb has this function(but not open :( ) by class Transfer/TransferDb/TransferTable,  if H2 has the dabase translate function between itself with most dabatases and provided with Open Java API style... that will be more excellent and stronger^_^

2008/7/30 Lee,YB <rainy...@gmail.com>



--
****ASTROXL****
^y^

Thomas Mueller

unread,
Jul 31, 2008, 11:05:06 PM7/31/08
to h2-da...@googlegroups.com
Hi,

I'm sorry, I don't think there is a transfer feature like that in H2.
Maybe 'linked tables' will help however. See:

http://www.h2database.com/html/grammar.html#createlinkedtable
http://www.h2database.com/html/functions.html#linkschema

The idea is to create linked tables to the other database, then copy
the tables using:
CREATE TABLE X AS SELECT * FROM Y
and finally drop the linked tables.
You still need to create the constraints and indexes however.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages