lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

Extend H2 with Java Functions #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I was using HSQLDB and extended it adding a java STRCMP function
like in this example

http://blog.taragana.com/index.php/archive/tip-how-to-extend-hsqldb-rdbms-
with-java/

When I try the same thing with H2DB I get an error

org.h2.jdbc.JdbcSQLException: Function 
com.check1two.util.StringOrder.STRCMP not found; SQL statement:

Is this feature of extending supported with H2DB?

I am using the org.h2.jdbcx.JdbcConnectionPool

Thanks
Manuel

Original issue reported on code.google.com by manuelti...@gmail.com on 15 Nov 2009 at 6:41

GoogleCodeExporter commented 9 years ago
> Is this feature of extending supported with H2?

Not exactly like how it works with HSQLDB. You need to create an alias:
http://www.h2database.com/html/grammar.html#create_alias

Is this enough for you, or do you need to be able to call a function without
registering it? If yes, why?

Original comment by thomas.t...@gmail.com on 16 Nov 2009 at 6:27

GoogleCodeExporter commented 9 years ago
In version 1.2.124, you can create functions in source code form.
See also:
http://www.h2database.com/html/features.html#user_defined_functions
http://www.h2database.com/html/grammar.html#create_alias

I'm closing this issue for now.

Original comment by thomas.t...@gmail.com on 20 Nov 2009 at 4:53