You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by mrinalkamboj <mr...@gmail.com> on 2017/02/28 12:13:55 UTC

How to use H2 database functions in the Sql query using .Net APIs

I am trying to use the following query from the .Net client:

*select _key,OrderId, OrderName, OrderDateTime, OrderValue, OrderAddress
from OrderEntity Where REGEXP_LIKE(OrderAddress,?)*

Where for the placeholder ?, I supply the valid Regular expression, but
following is exception generated:

*Caused by: org.h2.jdbc.JdbcSQLException: Function "REGEXP_LIKE" not found;
SQL statement: select _key,OrderId, OrderName, OrderDateTime, OrderValue,
OrderAddress from OrderEntity Where REGEXP_LIKE(OrderAddress,?)*

I can use the Like operator effectively, as follows, but that's not enough I
need to do complex regex mapping

*select OrderId, OrderName, OrderDateTime, OrderValue, OrderAddress from
OrderEntity Where OrderAddress like '%' || ?*

This also seems to be the case for other H2 database functions available at
the following link

http://www.h2database.com/html/functions.html



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-use-H2-database-functions-in-the-Sql-query-using-Net-APIs-tp10939.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to use H2 database functions in the Sql query using .Net APIs

Posted by Sergi Vladykin <se...@gmail.com>.
You can use any client you want. You just have to implement your SQL
function in Java and deploy it on each Ignite node (add jar with your Java
class with SQL function to Ignite node classpath).

Sergi

2017-03-01 11:20 GMT+03:00 mrinalkamboj <mr...@gmail.com>:

> @Sergi does it mean to use these functions, I need to use the Apache Ignite
> only with Java, not with other clients like C#. As I don'e see a way to
> include Java function in the C# code or can a separate java binary can be
> created, but still I am not sure how would C# inform Apache ignite about
> the
> functions created
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-use-H2-database-functions-in-
> the-Sql-query-using-Net-APIs-tp10939p10962.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: How to use H2 database functions in the Sql query using .Net APIs

Posted by mrinalkamboj <mr...@gmail.com>.
@Sergi does it mean to use these functions, I need to use the Apache Ignite
only with Java, not with other clients like C#. As I don'e see a way to
include Java function in the C# code or can a separate java binary can be
created, but still I am not sure how would C# inform Apache ignite about the
functions created



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-use-H2-database-functions-in-the-Sql-query-using-Net-APIs-tp10939p10962.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to use H2 database functions in the Sql query using .Net APIs

Posted by Sergi Vladykin <se...@gmail.com>.
Currently you have to write your SQL functions in Java.

Sergi

2017-02-28 19:51 GMT+03:00 mrinalkamboj <mr...@gmail.com>:

> Thanks @Sergi, this is Java code, will it work in a similar way for .Net
> too
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-use-H2-database-functions-in-
> the-Sql-query-using-Net-APIs-tp10939p10950.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: How to use H2 database functions in the Sql query using .Net APIs

Posted by mrinalkamboj <mr...@gmail.com>.
Thanks @Sergi, this is Java code, will it work in a similar way for .Net too



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-use-H2-database-functions-in-the-Sql-query-using-Net-APIs-tp10939p10950.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How to use H2 database functions in the Sql query using .Net APIs

Posted by Sergi Vladykin <se...@gmail.com>.
Sorry, right now Ignite uses an older H2 version. I hope we will be able to
upgrade it soon, but for now you can go with user defined functions [1].

[1]
https://ignite.apache.org/releases/1.8.0/javadoc/org/apache/ignite/cache/query/annotations/QuerySqlFunction.html

Sergi

2017-02-28 15:13 GMT+03:00 mrinalkamboj <mr...@gmail.com>:

> I am trying to use the following query from the .Net client:
>
> *select _key,OrderId, OrderName, OrderDateTime, OrderValue, OrderAddress
> from OrderEntity Where REGEXP_LIKE(OrderAddress,?)*
>
> Where for the placeholder ?, I supply the valid Regular expression, but
> following is exception generated:
>
> *Caused by: org.h2.jdbc.JdbcSQLException: Function "REGEXP_LIKE" not found;
> SQL statement: select _key,OrderId, OrderName, OrderDateTime, OrderValue,
> OrderAddress from OrderEntity Where REGEXP_LIKE(OrderAddress,?)*
>
> I can use the Like operator effectively, as follows, but that's not enough
> I
> need to do complex regex mapping
>
> *select OrderId, OrderName, OrderDateTime, OrderValue, OrderAddress from
> OrderEntity Where OrderAddress like '%' || ?*
>
> This also seems to be the case for other H2 database functions available at
> the following link
>
> http://www.h2database.com/html/functions.html
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/How-to-use-H2-database-functions-in-
> the-Sql-query-using-Net-APIs-tp10939.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>