Unix Technical Forum

Re: Unloading a DECIMAL with no period

This is a discussion on Re: Unloading a DECIMAL with no period within the Informix forums, part of the Database Server Software category; --> On Fri, 2007-10-26 at 07:17 -0700, Omar Muņoz wrote: > Hi. > I have to deliver an unload-like file ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 05:29 PM
Carsten Haese
 
Posts: n/a
Default Re: Unloading a DECIMAL with no period

On Fri, 2007-10-26 at 07:17 -0700, Omar Muņoz wrote:
> Hi.
> I have to deliver an unload-like file from a query
> with many DECIMAL data, but they require that numbers
> be rounded and be shown with no period. But when I use
> unload the final file shows "250.0" instead of "250",
> which is what they want.
> I didn't find anything about this issue in the SQL
> Reference (It just mentions that DECIMAL uses format
> #.# and INT uses #, but I'm afraid of getting overflow
> error if I convert query results in integer) or in que
> GLS Reference. I wonder if somebody can help me on
> this.


It would help if you mentioned the version of engine and/or operating
system and/or client language you're using, since that defines the set
of tools available to solve your problem. Conceivable solutions include:

* If your engine is sufficiently new, you could try to cast the decimal
column(s) to int8.
* Let the file be created by unload as it is now, and post-process the
fil with awk, sed, or perl to remove the decimals.
* Don't use unload at all and instead write a simple program in ESQL/C,
Python, Perl, Ruby, PHP, or whatever, to create the file in the format
you need.

HTH,

--
Carsten Haese
http://informixdb.sourceforge.net


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com