unload truncates decimal values
Posted in 2009
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Migration, Import/Export & Data Conversion, Internationalization & Character Sets, Versions, Editions & End-of-Life
IDS10 Unload produces scrambled or truncated decimals.
Do you have any idea why? It worked fine in 9.4
Environment:
Linux 2.6.16.46-0.12-smp x86_64
IDS 10.00.FC9
4GL 7.32.FC4
CLIENT_LOCALE=hu_hu.8859-2
DB_LOCALE=hu_hu.8859-2
Try this from isql (not from dbaccess!) or from a 4GL program:
create table bh
(
debit decimal(18, 6) default 0.0 not null,
intr char(1) default 'N' not null ,
credit decimal(18, 6) default 0.0 not null
);
insert into bh values (3628.842082,"N",70876588.549855);
unload to bh.unl select * from bh;
> cat bh.unl
3628,842082|N|70876588,5498558żG|
After DBMONEY was set to ",Ft" the unload command produced truncated decimal
value:
> cat bh.unl
3628,842082|N|70876588|
It is strange, that the first decimal is correct.
On Thu, Sep 24, 2009 at 06:06, LAJOS ROHOSKA <rohoska@freemail.hu> wrote:
> IDS10 Unload produces scrambled or truncated decimals.
> Do you have any idea why? It worked fine in 9.4
>
> Environment:
> Linux 2.6.16.46-0.12-smp x86_64
> IDS 10.00.FC9
> 4GL 7.32.FC4
> CLIENT_LOCALE=hu_hu.8859-2
> DB_LOCALE=hu_hu.8859-2>
> Try this from isql (not from dbaccess!) or from a 4GL program:
>
OK - let's try to get this straight. Is the problem in ISQL and I4GL, or is
the problem in IDS and DB-Access?
If you use DB-Access to do the unload, do you get the correct result with,
and without, DBMONEY set? If so, then the problem is not IDS 10.00 per se -
that is producing the correct answer. If the DB-Access + IDS combination is
producing the error, then your original claim (IDS 10 unload is broken) is
more plausible.
If you don't get the problem with DB-Access but you do get the problem with
I4GL 7.32 or ISQL 7.32, then we need to know which version of I4GL or ISQL
you were using when it worked with IDS 9.40. If it was the same version of
I4GL, then we have a very odd situation; if you were using a different
version, we can probably point the finger at I4GL.
Please note that the LOAD and UNLOAD statements are not part of IDS; you
cannot use them in a stored procedure, for example. They are emulated by
programs that choose to do so - DB-Access and ISQL and I4GL are three such
programs.
> create table bh
> (
> debit decimal(18, 6) default 0.0 not null,
> intr char(1) default 'N' not null ,> credit decimal(18, 6) default 0.0 not null
> );
>
> insert into bh values (3628.842082,"N",70876588.549855);>
> unload to bh.unl select * from bh;>
> > cat bh.unl
> 3628,842082|N|70876588,5498558żG|
>
There seems to be a stray '8żG' at the end of the output which should
not be there.
> After DBMONEY was set to ",Ft" the unload command produced truncated
> decimal
> value:
> > cat bh.unl
> 3628,842082|N|70876588|
>
> It is strange, that the first decimal is correct.
>
That is strange, as you say. Did you reload the data, or did you simply
rerun the UNLOAD with the new setting of the environment variable?
I don't have an explanation - it looks dubious (aka buggy) to me.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
Stephen
Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html>
- "I detest life-insurance agents: they always argue that I shall some
day
die, which is not so."
--0016e64079cc35f31504745e79ec
> OK - let's try to get this straight. Is the problem in ISQL and I4GL, or is
> the problem in IDS and DB-Access?
The problem is in ISQL and I4GL only, DB-Access works fine. As far as I know
ISQL is written in I4GL but DB-Acces is not (maybe in C).
> then we need to know which version of I4GL or ISQL
> you were using when it worked with IDS 9.40.
I am trying to set up the old environment.
> create table bh
> (
> debit decimal(18, 6) default 0.0 not null,
> intr char(1) default 'N' not null ,> credit decimal(18, 6) default 0.0 not null
> );
>
> insert into bh values (3628.842082,"N",70876588.549855);
The problem is somewhere around handling the character data type.
unload to bh.unl select debit,credit,intr from bh;produces correct result, but if we put the character data before the decimal
data
unload to bh.unl select debit,intr,credit from bh;then the second decimal value will be wrong in the unl file.
On Fri, Sep 25, 2009 at 01:37, LAJOS ROHOSKA <rohoska@freemail.hu> wrote:
> > OK - let's try to get this straight. Is the problem in ISQL and I4GL, or
> is
> > the problem in IDS and DB-Access?
>
> The problem is in ISQL and I4GL only, DB-Access works fine. As far as I
> know
> ISQL is written in I4GL but DB-Acces is not (maybe in C).
>
ISQL is written in C, just like DB-Access is. I don't recall whether you
identified the version of ISQL that you are using. However, if it is not
7.50, then one possibility is that you should upgrade.
> > then we need to know which version of I4GL or ISQL
> > you were using when it worked with IDS 9.40.
>
> I am trying to set up the old environment.
>
> > create table bh
> > (
> > debit decimal(18, 6) default 0.0 not null,
> > intr char(1) default 'N' not null ,> > credit decimal(18, 6) default 0.0 not null
> > );
> >
> > insert into bh values (3628.842082,"N",70876588.549855);>
> The problem is somewhere around handling the character data type.
> unload to bh.unl select debit,credit,intr from bh;> produces correct result, but if we put the character data before the
> decimal
> data
> unload to bh.unl select debit,intr,credit from bh;> then the second decimal value will be wrong in the unl file.
>
That begins to sound like a bug - and therefore something that would be
fixed by an upgrade unless you are already on the latest version of ISQL.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
Stephen
Leacock<http://www.brainyquote.com/quotes/authors/s/stephen_leacock.html>
- "I detest life-insurance agents: they always argue that I shall some
day
die, which is not so."
--000feaeb44a5d56974047495f1f3