Subject RE: [ib-support] Showing a different value
Author Paul Schmidt
On 26 Oct 2001, at 17:09, Ignace MARTIN wrote:

Thanks, to you and all who replied, I decided that the best solution
was a stored procedure, that reads the table, replaces the values
that need replacing, and the outputs the result.

Paul






> If you do not want to create a reference table,
> you can create a function IFTE(INTEGER,INTEGER,CSTRING,CSTRING)
> returning CSTRING written in C like this
>
> extern "C" char* ISC_EXPORT IFTE(short *i1, *i2,char *sthen,char
> *selse) {
> if (*i1 == *i2) return sthen;
> else return selse;
> }
>
>
> declaration like this :
>
> DECLARE EXTERNAL FUNCTION IFTE
> INT, INT, CSTRING(80), CSTRING(80)
> RETURNS CSTRING(80)
> ENTRY_POINT "IFTE" MODULE_NAME "mylib"
>
> and call
>
> SELECT
> IFTE(MYINTVAR,1,'A',IFTE(MYINTVAR,2,'B',IFTE(MYINTVAR,3,'C','D')))
> FROM MYTABLE
>
>
> Rgds,
>
> Ignace
>
>
> -----Message d'origine-----
> De : Paul Schmidt [mailto:paul@...]
> Envoye : jeudi 25 octobre 2001 20:44
> A : ib-support@yahoogroups.com
> Objet : [ib-support] Showing a different value
>
>
>
> Dear List:
>
> I have a field which contains a value, say 0,1,2,3,4,5
>
> Now if the value is 0, I want to display the letter B, if the value is
> 1, then I want to display the letter O, if it's 2 I want to display E,
> if it's 3 oh you get the idea.
>
> I want to display this within a select so that the number is
> retrieved, and the letter is displayed. Anyone know a simple way to
> do this?
>
> Thanks,
>
> Paul
>
>
>
>
>
> Paul Schmidt
> Tricat Technologies
> paul@...
> www.tricattechnologies.com
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Pinpoint the right security solution for
> your company- Learn how to add 128- bit encryption and to authenticate
> your web site with VeriSign's FREE guide!
> http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/dpFolB/TM
> ---------------------------------------------------------------------~
> ->
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>


Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com