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.


No comments:

Post a Comment