Subject Re: Querying for words with special characters
Author Adam
--- In firebird-support@yahoogroups.com, "ion2w" <ion2w@...> wrote:
>
> --- In firebird-support@yahoogroups.com, "Adam" <s3057043@> wrote:
> >
> > --- In firebird-support@yahoogroups.com, "ion2w" <ion2w@> wrote:
> > >
> > > If the word:
> > >
> > > Alice's
> > >
> > > is stored in my database. How do I retrieve it?
> > >
> >
> > Use an extra ' as an escape character
> >
> > select *
> > from employee
> > where firstname = 'Alice''s';
> >
> > (That is two apostrophies not a double quote character)
> >
> > Adam
> >
>
> I tried the two apostrophes, but didn't get any records.
>
> My data looks like this: Alice's
> My SQL looks like this: SELECT * FROM CONTACTS WHERE COMPANY
= 'Alice''s'
>
> What am I missing?

Transaction isolation? Character set differences? Case sensitive?

This returns one record in my test DB

select *
from employee
where lastname = 'O''Neill'

(and that is pretty much all you are doing). Our tables are plain old
charset none with boring ASCII values.

Do the obvious:

SELECT * FROM CONTACTS WHERE COMPANY LIKE 'Alice%'

And make sure it exists in that format. Otherwise you may need to
commit the transaction that inserted the record, and make sure your
transaction is not started before it is committed.

Adam