It sounded from the original post as if you'd already created an in 
memory/embedded database with something like jdbc:h2:mem: and populated it 
via CSVREAD().  After it's populated, you can use SCRIPT TO statements from 
inside your database to send the data in the in-memory database out to a 
file which can later be used to restore the data into another H2 database 
that is file based.

"the created Data has to be used from other programms, so it won't be very 
clever to use it in-memory"
I hear:
- It needs to be persisted and made available - either by using a file or 
allowing others to connect to it?  Based on the next comment, I presume a 
file that you can pass around or others will come get.

"is there a possibility to save a h2 in-memory DB to the filesystem and 
read it like a regular h2 file DB"
- Not directly.  You can:
 a.) Backup from in memory to a file, then restore that file into a new 
file based (Non - in memory) database that you create. then either give 
others access to the file, or...
 b.) Make the in memory database, or subsequently 
restored-to-file-based-database accessible over the network from h2 jdbc 
clients by using org.h2.tools.Server instead of embedded mode H2
 c.) depending on the complexity of the data and how you want to share it 
... use sql statement CSVWRITE() 


Also - one more thing I remembered - if you're doing CREATE TABLE AS SELECT 
STUFF FROM CSVREAD(); - H2 creates enourmously long varchar column types by 
default (cuz it doesn't know how long the data _could_ be).  It's often 
more appropriate to pre-create your table with sane datatypes/lengths and 
then INSERT INTO YOURTABLE (FIELDLIST) SELECT FIELDLIST FROM CSVREAD(), 
then index/analyze the table according to your subsequent operations on it.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/h2-database/-/KDykTKzAdWIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to