Strange behaviour with DBMONEY

Øyvind Gjerstad <[email protected]> Fri, 31 Jan 2020 08:43:08 +0100
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <[email protected]>
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]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss