How I perform dbload with decimal ???
Posted in 2000
Topics: General Discussion
>
>command
>dbload -d dbpplay -c inf -l erro -e 1 -n 1
>-----------------------------------------------------------------------
>FILE teste.txt (a 1-10, b 11-30, c 31-50, d 51-59)>INSERT INTO teste VALUES (a,b,c,d)
file teste.txt
12121212121212121212121211111121212121212121212121212121112
The character-position file statement assumes that the load file is
fixed lenght. How Do I have with decimal datatype ???
--
F'bio Antunes
Fanix Consultoria Ltda.
Brasil - SP
Sent via Deja.com http://www.deja.com/
Before you buy.
fabioantunes@my-deja.com wrote:
> >
> >command
> >dbload -d dbpplay -c inf -l erro -e 1 -n 1
> >-----------------------------------------
> >FILE teste.txt (a 1-10, b 11-30, c 31-50, d 51-59)> >INSERT INTO teste VALUES (a,b,c,d)>
> file teste.txt
> 12121212121212121212121211111121212121212121212121212121112
>
> The character-position file statement assumes that the load file is
> fixed lenght. How Do I have with decimal datatype ???
I'm not certain, but I suspect that you have DECIMAL(10,4) or something
similar,
and there is no decimal point in the data so DBLOAD can't handle your data.
The HPL might be able to help. I respectfully suggest a simpler solution
might
be to obtain the DBLDFMT command from the IIUG archives and use it to
handle the
problem -- it has explicit support for inserting decimal points into data
where
the point is implicit. And, of course, if you also get SQLCMD command, you
can
do it all in one fell swoop:
dbldfmt -l 60 -d 1-10.4 -d 11-30.5 -d 31-50.6 -d51-59.2 teste.txt |
sqlreload -d dbpplay -t teste
And you can control the error handling per DB-Load if you want to.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include
Guardian of DBD::Informix v0.95 -- http://www.perl.com/CPAN
"Windows is NOT a virus: a virus is small and efficient."