All Forums Tools
toadrw 69 posts Joined 07/04
08 Jul 2015
File Writer operator writing out 0 for decimal columns with precision greater than 18.

Hello:
When exporting data to a flat file we seeing that decimals with over 18 precision are being returned as zero.  MaxDecimalDigits is set to 38 so is there something else we are doing incorrectly here?
Columns 1, 3 and 5 are being exported as zero. So the first column 2687.350 ends up in the flat file as 0.  
Using Teradata 15 and TPT 15.
Below are the table create schema and operators.

Create table test.decimaltest2
(col1 decimal(38,3),
col2 decimal(12,2),
col3 decimal (19,4),
col4 decimal (18,8),
col5 decimal (38,12));

Insert into test.decimaltest2 values (2687.350,1338.060,1671.470,857.560,1247.960);

DEFINE SCHEMA TDSourceTable (
col1 DECIMAL(38,3),
col2 DECIMAL(12,2),
col3 DECIMAL(19,4),
col4 DECIMAL(18,8),
col5 DECIMAL(38,12)
);

DEFINE OPERATOR WriteOperator
TYPE DataConnector Consumer
SCHEMA *
ATTRIBUTES (
VARCHAR PrivateLogName = 'ConsumerLog'
,VARCHAR FileName = 'C:\exp_decimaltest2.txt'
,VARCHAR Format = 'Delimited'
,VARCHAR IndicatorMode = 'N'
,VARCHAR OpenMode = 'Write'
,VARCHAR FileList = 'N'
,VARCHAR TextDelimiter = '|'
);

DEFINE OPERATOR ExportOperator
TYPE Export
SCHEMA TDSourceTable
ATTRIBUTES (
VARCHAR Tdpid = 'tdat'
,VARCHAR UserName = 'user1'
,VARCHAR UserPassword = '<PASSWORD>'
,INTEGER MaxDecimalDigits = 38
,VARCHAR SelectStmt = 'SELECT col1, col2, col3, col4, col5 FROM Test.decimaltest2;'
,VARCHAR PrivateLogName = 'ExportLog'
);
Thanks again for your help!

feinholz 1234 posts Joined 05/08
09 Jul 2015

This is a known issue and we are currently working on the fix.
 

--SteveF

toadrw 69 posts Joined 07/04
09 Jul 2015

Thank you Steve!  We're working around this by casting, but it is nice to know that it wasn't something we were doing wrong (which is rare). :P

s_reddy 5 posts Joined 06/14
01 Oct 2015

Steve,
Is this issue fixed?.If,yes.What is the fix version ?
 

sboucher 1 post Joined 06/13
01 Sep 2016

Hello,
we have the same problem. Is this Issue fixed ?

feinholz 1234 posts Joined 05/08
02 Sep 2016

I am trying to look up when this was fixed.
Since it looks like several people are having issues, I need to know what version of TPT everyone on this thread is running.

--SteveF

feinholz 1234 posts Joined 05/08
02 Sep 2016

Ok, if the "issue" that we fixed is what I think, these are the releases in which the issue was resolved:
 
14.10.00.014
15.00.00.001
 

--SteveF

You must sign in to leave a comment.