[Fwd: Re: [Q] Select Problem]
Posted in 1998
Message-ID: <352CE0E9.3BAF@sprynet.com>
Date: Thu, 09 Apr 1998 10:53:29 -0400
From: "Vijay R. Anisetti" <rambabu@sprynet.com>
X-Mailer: Mozilla 3.0 (Win95; I)
MIME-Version: 1.0
To: Informix mailing list <informix-list@rmy.emory.edu>,
jamienash@cim.co.uk
Subject: Re: [Q] Select Problem
References: <98Apr9.104453bst.27777@gateway.cim.co.uk>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
jamienash@cim.co.uk wrote:
>
> Hello Pawel,
> {
> The Problem.............
> 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 ?
>
> please help {I'll try}
> }
>
The easiest way I can think of would be a stored procedure as:
some of the assumptions:
a. needs changes according to the type of numeric value
b. error checking needs to be done
c. some more if i have misssed any
create procedure check_leading(l integer)
returning integer;
define c char(10);
let c = l;
return c[1,1];
end procedure;
select * from blahblah where check_leading(yadayda) = 5; -- or what everthe digit you want to check.
hope this HELPS ...
Vijay Rambabu