Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Thu, 23 May 2002 @ 21:29:13 GMT





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




Subj:   Format statement and floating point numbers
 
From:   Michael McBride



Can anyone give me an idea how to solve this problem: I need to output character string as a right justified number zero filled from the left in a fixed length of 20 bytes. All the values will be 20 digits or less. I thought I had the answer, but BTEQ and Fast Export won't let me put a floating zero fill format statement longer than 18 digits (see output examples Q1 and Q2 below). Is there a parameter I can set that allows formatting strings longer than 18 digits? The final output has to fixed length 20 digits!!!

Q1:
SELECT
sth_employee_id (FLOAT,FORMAT'9(18)')
FROM aeo_devlworkdb.flat_tlog
WHERE sth_employee_nbr is not null ;

 *** Query completed. 4907 rows found. One column returned.
 *** Total elapsed time was 1 second.

   STH_Employee_ID
------------------
000000000511903605

Q2:
SELECT
sth_employee_id (FLOAT,FORMAT'9(19)')
FROM aeo_devlworkdb.flat_tlog
WHERE sth_employee_nbr is not null ;
SELECT
sth_employee_id (FLOAT,FORMAT'9(19)')
FROM aeo_devlworkdb.flat_tlog
WHERE sth_employee_nbr is not null ;
 *** Failure 2621 Bad character in format or data of
FLAT_TLOG.STH_Employee_
ID.
                Statement# 1, Info =0
 *** Total elapsed time was 1 second.

Michael E. McBride
Teradata Database Administrator
Teradata Certified Master
American Eagle Outfitters





     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008