1

I am using Teradata bteq utility to run teradata commands form unix server.

I am able to connect to teradata, but while fetching data it gives only 7 columns and a dot(.) at end of decimal field. I am using query, select * from databasename.tablename

output column1(decimal) column2 column3(decimal) 74664. S 67469.

Don't know why it giving dot(.)

Can anybody help??

1 Answers1

2

By default BTEQ returns data in REPORT format with a width of 75 characters (this is an ancient default probably based on mainframe terminals), when you EXPORT it's 254.

You can easily change that by submitting a .SET WIDTH xxx; 65531 being the maximum.

Regarding the DECIMALs, check the definition, they're probably DECIMAL(x,0) without fractional part and the default format for a DECIMAL always includes the period.

If you want to get rid of the period you have to change the format either permanently changing it on column level or for a query using:

ALTER TABLE tab ADD column1 FORMAT '-(i)9'
or
SELECT column1 (FORMAT '-(i)9')
dnoeth
  • 59,503
  • 4
  • 39
  • 56
  • One more thing, FORMAT '-(i)9' not working with select *, can you suggest for select * – user3848027 Jul 17 '14 at 09:40
  • A FORMAT is applied on individual column, a "SELECT *" will always use the format according to the column definition. – dnoeth Jul 17 '14 at 11:08