Re: [derby] searching within a blob

2019-09-30 Thread Alex O'Ree
yup, definitely a blob. it looks like the like operator doesnt work for
blobs, or maybe i need a cast or some function to the conversion

On Mon, Sep 30, 2019 at 6:50 PM Rick Hillegas 
wrote:

> On 9/30/19 9:18 AM, Alex O'Ree wrote:
>
> I have a use case where i have string data stored in a blob and i want to
> perform a query similar to
>
> select * from table where column1 like '%hello world%'
>
> It doesn't look like this is possible with derby out of the box. Is there a
> way to create a function that calls a java function or something that can
> be used to make this work?
>
>
> Just to clarify, the column has type BLOB rather than CLOB? The following
> script works for me on CLOB types:
>
> connect 'jdbc:derby:memory:db;create=true';
> CREATE TABLE t (a CLOB);
> INSERT INTO t VALUES ('this will not match'), ('but shello worldly will');
> SELECT * FROM t WHERE a LIKE '%hello world%';
>
> Thanks,
>
> -Rick
>


Re: [derby] searching within a blob

2019-09-30 Thread Rick Hillegas

On 9/30/19 9:18 AM, Alex O'Ree wrote:

I have a use case where i have string data stored in a blob and i want to
perform a query similar to

select * from table where column1 like '%hello world%'

It doesn't look like this is possible with derby out of the box. Is there a
way to create a function that calls a java function or something that can
be used to make this work?

Just to clarify, the column has type BLOB rather than CLOB? The 
following script works for me on CLOB types:


   connect 'jdbc:derby:memory:db;create=true';
   CREATE TABLE t (a CLOB);
   INSERT INTO t VALUES ('this will not match'), ('but shello worldly will');
   SELECT * FROM t WHERE a LIKE '%hello world%';

Thanks,

-Rick



Re: [derby] searching within a blob

2019-09-30 Thread Peter Ondruška
Alex, I think this may be a solution:
https://db.apache.org/derby/docs/10.14/tools/rtoolsoptlucene.html

On Mon, 30 Sep 2019 at 18:18, Alex O'Ree  wrote:

> I have a use case where i have string data stored in a blob and i want to
> perform a query similar to
>
> select * from table where column1 like '%hello world%'
>
> It doesn't look like this is possible with derby out of the box. Is there
> a way to create a function that calls a java function or something that can
> be used to make this work?
>


[derby] searching within a blob

2019-09-30 Thread Alex O'Ree
I have a use case where i have string data stored in a blob and i want to
perform a query similar to

select * from table where column1 like '%hello world%'

It doesn't look like this is possible with derby out of the box. Is there a
way to create a function that calls a java function or something that can
be used to make this work?