gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] type of search pattern for demographics


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] type of search pattern for demographics
Date: Sat, 21 Aug 2004 10:03:51 +0200
User-agent: Mutt/1.3.22.1i

> >Select * from patients where 'firstname like 'pe*' and lastname like 'bl*',
> >order by id, surname, firstname, street, suburb, postcode, dob. > list> 
> >pick one. Name is plonked in top bar and under the hood the datbase is 
> >queried 
> >for all the clinical records for a patient with the unique Id from this 
> >query.
> look that's just too simple. In these times of intellectual property 
But simple can be powerful. It is at least useful to consider
what Richard has to say. After all he already DID implement a
working solution. Or maybe I missed the satire here ?

> in postgres , the above 'pe*' and 'bl*' becomes 'pe$' and 'bl$' ; also 
No. Only when using "like" queries. And then it would become
'pe%'. If using regex SQL operators (* and *~) you can pretty
much use stock regexes.

> not sure if postgres has a "set ignorecase off"
No. But you can do that per query in several ways:

lower/upper()
ilike
*~

> ( I think "ilike"  is a ignore-casing  "like" ) ,
yes

> - and  using the "*" field operator in select ...
... isn't particularly good style. Reason being less that it
is harder to extract column names but rather that the returned
fields may differ depending on schema changes.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]