Re: Excluding multiple items from the selection criteria
Posted in 1998
SUHAS TEMBE wrote:
>
> Huy,
>
> I have 4GL (ver. 6.05) code running on the Informix Online 7.1 Dynamic
> Server.
>
> A screen form has been designed which has ten fields & I am accepting data
> (which is entered by the users in these fields) using the "CONSTRUCT"
> statement.
>
> One of the fields "old_type" [tpye char(2)] (part of the Construct
> statement) accepts 2 char values viz "SA", "DR", "MT", "MV", etc. So
> whenever they need information for say codes "SA" & "DR", they enter SA|DR
> in the screen field, which internally gets converted (by virtue of the
> Construct statement) to the following SQL :
>
> select * from table
> where old_type in ('SA','DR');>
> My question to you is that, if they want info. for codes other than "SA" &
> "DR" (i.e data for codes excluding these two), what would they have to enter
> on the screen field, so that internally the select statement would
> automatically look like :
>
> select * from table
> where old_type not in ('SA','DR');>
> Note : I tried entering the following on the entry screen field :
>
> [^SAMV]*
>
> But, this excludes all old_type codes starting with S, A, M & V and not SA &
> MV.
>
> I would deeply appreciate if you could mail me the reply as soon as
> possible.
>
> Thanks for your time.
>
> Regards,
>
> Suhas
>
> Suhas Tembe
> Email : stembe@arrowshirt.com
> stembe@msn.com
There are many things CONSTRUCT will not do. I suspect this is one of
them. You could try "[^SD][^AR]*" but it excludes more than you want.
A more complex alternative is to allow users to press a key in this
field to set a flag which is then used to control some code that inserts
the NOT into the SQL output by CONSTRUCT. It's clumsy but should work.
An alternative (if your users are familiar with SQL) is to allow them to
edit the output of CONSTRUCT in a WORDWRAP field. I have a hidden key to
do this so the experts can create more complex queries.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
Mail: Peter.Lancashire.PL1@bayer.co.uk
---
My Internet plumbing does not allow me to mail and post news together.
Sorry.
All opinions are my own and not those of Bayer plc.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/