Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 06 Nov 2000 @ 22:49:41 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Adding leading zeros in SQL output
From:   Sam Mosley

John Yavanovich gave you a start in the right direction, but there is one additional thing to consider. When you define the number of characters to hold the result, leave room for the sign. Even if the number is always positive, and the sign doesn't print, Teradata will truncate the number if you don't leave room for it. Thus an integer, which can be expressed in 10 digits requires 11 characters to hold the result. The same effect will occur on other numeric data types, so plan accordingly. Also, note that if you are trying to bring formatted output back through an ODBC tool like Queryman, it will ignore your formatting. The formatting works fine in BTEQ, FastExport, and CLI programs you write.

Sam Mosley
VLDB Systems, Inc.

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023