Re: Strange behaviour with DBMONEY

Øyvind Gjerstad <[email protected]> Mon, 3 Feb 2020 08:58:43 +0100
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
I can't change it on the server side currently, too many other devs 
working with the database, and I think I have to be able to change it on 
the server side, because currently it works when it has the same value 
on the client and server side, but it does not work when it is empty on 
the client side.

On 31/01/2020 20:45, Mike Aubury wrote:
> I thought DBMONEY in Aubit4GL only worked with single character 
> currency symbols.
> Does it work if its set to just "K" (for the purposes of testing) ?
>
> On Fri, 31 Jan 2020 at 08:27, Øyvind Gjerstad 
> <[email protected] <mailto:[email protected]>> 
> wrote:
>
>     Recently discovered a strange behaviour, here it is boiled down to
>     a minimum:
>
>     Given:
>     export DBMONEY="Kr ," (on the client AND server side).
>
>     create table foo(dec_1 decimal(13,3));
>     insert into foo (dec_1) values (42);  -- or whatever
>     select * From foo;
>     12,000
>
>     And this 4gl program:
>
>     database testogj1
>     main
>       define p_dec_1 decimal(13,3)
>
>       select first 1 dec_1 into p_dec_1 from foo
>
>       insert into foo (dec_1) values (p_dec_1)
>     end main
>
>
>     After the 4gl program has run, the content of the table is:
>     select * From foo;
>     12,000
>     12,000
>
>     All well and fine. But if the program is run with DBMONEY unset
>     (or empty) on the client side (still the old value on the server),
>     the content of the table after this test is:
>     select * From foo;
>     12,000
>     12000,000
>
>     So, it seems like aubit 4gl receives the decimal value as a string
>     somehow, and (since DBMONEY is unset) does interpret the commas as
>     thousands separator.
>
>     This is a bit unexpected, and not the way it works in Informix
>     4gl. Although I think DBMONEY really is a flawed concept, it can't
>     easily be changed in an old and huge system.
>
>     tested on:
>     aubit 4gl 1.2, build 39, RHEL 6 and 7
>     aubit 4gl 1.5, build 1, HP-UX 11
>
>     -- 
>
>     *Øyvind Gjerstad *
>     Systemkonsulent
>
>     M +47 909 41 485
>     [email protected] <mailto:[email protected]>
>
>     *___________________*
>
>
>     *PostNord AS *
>     T +47 987 09300
>     IT og Forretningsutvikling
>     Øran Vest
>     Postboks 100
>     6301 Åndalsnes
>     www.postnord.no <http://www.postnord.no>
>
>     _______________________________________________
>     Aubit4gl-discuss mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>
-- 

*Øyvind Gjerstad *
Systemkonsulent

M +47 909 41 485
[email protected] <mailto:[email protected]>

*___________________*


*PostNord AS *
T +47 987 09300
IT og Forretningsutvikling
Øran Vest
Postboks 100
6301 Åndalsnes
www.postnord.no <http://www.postnord.no>

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss