Your solution (using CHAR()) is the most platform independent
solution. SQL doesn't support escape characters. H2 supports it
however, see http://www.h2database.com/html/functions.html#sql239
> how to insert content of the (external) file into one column of one record.
I'm not sure if you mean this:
CREATE TABLE TEST(NAME VARCHAR);
INSERT INTO TEST VALUES(STRINGDECODE('Hello\nHallo\nBonjour'));
Regards,
Thomas
> create table test (name varchar(50), data varchar);
> insert into table test values ('Stepan', fileRead('c:\temp
> \stepan.xml', 'UTF-8'));
> insert into table test values ('Thomas', fileRead('c:\temp
> \thomas.xml', 'UTF-8'));
There is a feature request:
Built-in methods to read/write large objects (BLOB and CLOB):
FILE_STORE('test.sql', 'select data from test where id=1'),
FILE_READ('test.sql')
I have moved this up in the list, but it is still priority 2 at the moment.
> select fileWrite(data, 'c:\temp\stepan.xml', 'UTF-8') from test where
> name = 'stepan';
I'm not sure if a 'select with side effect' is a good idea. I'm also
not sure if a method that takes a query is a good idea (CSVWRITE does
that as well, but usually no parameters are required for CSVWRITE).
Another problem is: are two methods required for each (one for CLOB
and another for BLOB), or is one method for read and one for write
enough? What do you think?
Regards,
Thomas
> > languague. Although I heard, that You are going to implement
> > JavaScript as internal procedural languague of H2 via Rhino ;-)
> ...Or JavaFX? I do not want to spread false rumours.
My current idea is to support Java, using javac (starting a process).
Other compilers could be supported as well (the Eclipse compiler, any
script compiler). Basically, the compiler should be pluggable. A first
try has been implemented in the H2 Console. If you start the H2
Console with the command line options "-webScript true" you can
execute this 'script':
@JAVA
return "Hello " + "World";
It is not very flexible (the code block needs to return an Object).
Also, it is very slow currently because a new process is created.
Anyway it is quite useful (for me). There is one problem: security.
Does anybody know how to run code in a 'sandbox' (like Applets)?
Regards,
Thomas