Re: [Q] Select Problem
Posted in 1998
Pawel Stepniowski wrote: > > Hi, > > anyone know , how to get similar functionality for numerical as LIKE > does for string. > I am developing program which has common frame to select records , > restricted by user input . When user types in 'A*' all records begining > with A will be displayed. > But what if field is not of text type ? How to display records begining > with 5 ? That's a bit like asking to see only prime numbers. You are asking for numbers which are 5, in the 50s, in the 500s, in the 5000s, etc. This list will go on based on the actual precision of the numbers stored in this field. The LIKE (and MATCHES) operators are not very applicable to numeric values. Particularly because numeric values are right justified, and char are left justified. If this is something like a telephone number, and you want a certain area code, then it all comes down to database design. In that case this field should probably be a char type field. I guess you could write a stored procedure to do the job, but I would look at why this request is being made in the first place. Cheers, -- Mark. +----------------------------------------------------------+-----------+ |Mark D. Stock - Informix SA http://www.informix.com |//////// /| |mailto:mdstock@informix.com FAQ http://www.iiug.org |///// / //| | +-----------------------------------+//// / ///| | Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////| | Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////| |Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////| +----------------------+-----------------------------------+-----------+