Subject | Re: [firebird-support] Scandinavian letters. Wildcard searching??? |
---|---|
Author | John Jaabæk |
Post date | 2005-05-08T19:47:49Z |
Seems like I'm getting towards my goal. Thanks Aage.
I was using standard Win1251. Is it possible to change this character setting
after the database has been made or do I have to make a new one. Asking
before trying and making a shit out of everything.
Best regards John
I was using standard Win1251. Is it possible to change this character setting
after the database has been made or do I have to make a new one. Asking
before trying and making a shit out of everything.
Best regards John
On Saturday 07 May 2005 23:59, Aage Johansen wrote:
> John Jaabæk wrote:
> > Since I live in Norway, Scandinavia and having three letters you don't
> > have times 2, I'm really having fun doing searching the database. Divide
> > by zero when searching on Scandinavian letters. So I need to replace
> > them with wildcards. I know how. Simple procedure or UDF or done inside
> > PHP. Wherever But which wildcards are to be used??
> >
> > '%' - works as first charachter on the line. Not as number 2 or later.
> > '*' - does not work at all.
> > '?' - does not work at all.
> >
> > LIKE is handling '%' as first character.
> > CONTAINING is handling none. It is a wildcard search, but not good
> > enough.
>
> Will this help? (Norwegian letters are probably not shown correctly)
>
> The following returns 1:
> -- lowercase Norw. letters in string
> select count(*)
> from rdb$database
> where 'æøå' collate no_no containing 'Å'
> as does:
> -- uppercase Norw. letters in string
> select count(*)
> from rdb$database
> where 'ÆØÅ' collate no_no containing 'å'
> This returns 0:
> select count(*)
> from rdb$database
> where 'æøå' containing 'Å'
>
> The character set of the database is ISO8859_1, and I also specify
> ISO8859_1 when I connect. I'm using Fb/1.5.2.
>
>
> However (here, JOURNAL.OMTALE is a blob field)
> select count(*)
> from JOURNAL
> where OMTALE containing 'å'
> gives a different answer than
> select count(*)
> from JOURNAL
> where OMTALE containing 'Å'
> The counts are 16875 and 1274 resp. - adding "collate no_no" to 'å' or 'Å'
> makes no difference.
> Don't ask me why.
>
>
>
> So, with a char/varchar field, try to use
> select count(*)
> from JOURNAL
> where upper(SRT_NOR collate no_no) containing 'Å'
> The upper/collate will not work with a blob (gives: Data type unknown
> Invalid use of CHARACTER SET or COLLATE).
>
>
> --
> Aage J.
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
--
John H. Jaabæk