1. Quick EuSQL Question (Matt?)

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/

new topic     » topic index » view message » categorize

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

new topic     » goto parent     » topic index » view message » categorize

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/

new topic     » goto parent     » topic index » view message » categorize

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu