Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Decimal datatype issue with BTEQ

Suppose if you have a table called employee having column Salary declared as decimal(35,0).

Query: Select salary from employee;


The above query works fine in SQL Assistant. But if you try to run using Bteq, the output contains decimal point(dot)  at the end. See below.

salary
******
98765432109876543210987654321098765432.

If you can try Format '99999......999999' , you will get error because format allows only 30 digits. Alternative solution for this problem is use FORMAT 'Z(35)' or FORMAT '9(35)' instead of Decimal(35,0) to avoid dot at the end of the output if your query is running through BTEQ.


This post first appeared on Teradata SQL Reference, please read the originial post: here

Share the post

Decimal datatype issue with BTEQ

×

Subscribe to Teradata Sql Reference

Get updates delivered right to your inbox!

Thank you for your subscription

×