Re: [Q] How to convert numerical to character ?
Posted in 1998
Pawel Stepniowski wrote:
>
> > Informix will return data in any format that it can properly convert
> > the column into. What front end tool are you using? What output
> > format do you need?
> >
> > For example to get text from dbaccess/isql just 'UNLOAD TO file...'
> > or 'OUTPUT TO file ...' the output will be text. In 4GL or ESQL/C
> > you can just select the column into a 'char' type host variable or
> > in ESQL/C you can describe the statement and then just change the
> > type of the column in the sqlda structure or descriptor area (being
> > sure to allocate enough memory to hold the text).
> >
> > If you need more help, please be more specific.
> >
> > Art S. Kagel
>
> Hi,
>
> I am writting aplication in VC++. It works with Ingres via ODBC. Now , I have
> dialog
> which browse several tables (table is parameter for this dialog). Most of
> tables have text column as a key - but some of them integer. User can type in
> for example "53%" in
> search criterium field and expects that all record with 53 at tbe begining key
>
> column wiil be displayed in browser.
> It is easy for text type column
>
> select * from <my_table>
> where <my_text_col> like "53%">
> I nedd to handle this for integer values.
> I know that this can be slow but , first there will not be many records in
> these tables and
> I can add additional condition in select.
>
> Can I force temp table to be of text type
>
> select int_val, val_desc
> from my_table
> into temp foo>
> and values in foo are of text type ?
>
> We do not use stored procedures , so i want to avoid that solution
>
> --
> Pawel Stepniowski
> mailto:stepniow@quantum.pl
> internet: http://www.quantum.de/~pawel
It sounds to me as if this column should be character in the database.
If users are searching it by '53%' it must be some kind of thing like a
telephone or social security number, ie not really a number at all but a
string of digits. Is a design error coming back to bite you? If it is a
real number then maybe you could train your users to search for ranges
of numbers, eg all over 5300?
--
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/