1. Quick EuSQL Question (Matt?)
- Posted by cklester <cklester at yahoo.com>
Apr 13, 2006
-
Last edited Apr 14, 2006
Is there a search provision in EuSQL? That is, if I want to search for a term
in a particular record's field data, can I do it? :)
I envision something like:
all_recs = sql_find(DB_NAME, TEXT_TO_FIND, FIELD_NAME_TO_SEARCH)
and all_recs contains all the records matching the find.
If not, when can you get that done for me? :)
-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/
2. Re: Quick EuSQL Question (Matt?)
cklester wrote:
>
> Is there a search provision in EuSQL? That is, if I want to search for a term
> in a particular record's field data, can I do it? :)
>
> I envision something like:
>
> all_recs = sql_find(DB_NAME, TEXT_TO_FIND, FIELD_NAME_TO_SEARCH)
>
> and all_recs contains all the records matching the find.
>
> If not, when can you get that done for me? :)
You mean like:
all_recs = run_sql( "select * from my_table where my_field like '*" &
TEXT_TO_FIND & "*'" )
Matt Lewis
3. Re: Quick EuSQL Question (Matt?)
Matt Lewis wrote:
> cklester wrote:
> > Is there a search provision in EuSQL? That is, if I want to search for a
> > term
> > in a particular record's field data, can I do it? :)
> You mean like:
>
> all_recs = run_sql( "select * from my_table where my_field like '*" &
> TEXT_TO_FIND & "*'" )
Clever! :P
Thanks. :)
(Oh, how do I make it case insensitive?)
-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/
4. Re: Quick EuSQL Question (Matt?)
cklester wrote:
>
> Matt Lewis wrote:
> > cklester wrote:
> > > Is there a search provision in EuSQL? That is, if I want to search for a
> > > term
> > > in a particular record's field data, can I do it? :)
> > You mean like:
> >
> > all_recs = run_sql( "select * from my_table where my_field like '*" &
> > TEXT_TO_FIND & "*'" )
>
> Clever! :P
>
> Thanks. :)
>
> (Oh, how do I make it case insensitive?)
>
There isn't currently a way to do this. Basically, it would probably
require that UCASE/LCASE functions be added to texteval.e, and integrated
into eusql. An alternative work around would be to add a case insensitive
field to your database, and use upper/lower before you insert the data.
Yes, that's not a very nice solution...
Matt Lewis