Quantcast
Channel: Teradata Forums - Tools
Viewing all articles
Browse latest Browse all 4252

Export operator returning zero for decimals over 18 precision. - forum topic by toadrw

$
0
0

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!

Forums: 

Viewing all articles
Browse latest Browse all 4252

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>