Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Jun 2006 @ 10:56:16 GMT


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


Subj:   Re: Can we get Bteq output in HTML format?
 
From:   Ray, Edmond

There is no option for bteq to generate HTML automagically, but you can do it with SQL.

Here is an example of one I created for a customer.

     SELECT '' (TITLE '');
     SELECT '' (TITLE '');
     SELECT '' (TITLE '');
     SELECT '' (TITLE '');
     SELECT '' (TITLE '');
     SELECT '' (TITLE '');
     LOCKING ROW FOR ACCESS
     SELECT
       CASE WHEN RANK(1, A.Form ) MOD 2 = 0
            THEN ''
            ELSE ''
            END (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     FROM (SELECT Report_Form_Type_Cd
                , MIN(Report_Received_Dt) (FORMAT 'MMM. DD, YYYY')
                , MAX(Report_Received_Dt) (FORMAT 'MMM. DD, YYYY')
                , COUNT(*)
             FROM Report
            WHERE Report_Received_Dt BETWEEN ADD_MONTHS(DATE, -132) AND DATE
         GROUP BY 1
     ) A ( Form, OldestFiling, NewestFiling, TotalFilings )
     ORDER BY 2
     ;
     LOCKING ROW FOR ACCESS
     SELECT ''
     (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     , '' (TITLE '')
     FROM (SELECT 'TOTAL'
                , MIN(Report_Received_Dt) (FORMAT 'MMM. DD, YYYY')
                , MAX(Report_Received_Dt) (FORMAT 'MMM. DD, YYYY')
                , COUNT(*)
             FROM Report
            WHERE Report_Received_Dt BETWEEN ADD_MONTHS(DATE, -132) AND DATE
         GROUP BY  1
     ) A ( Form, OldestFiling, NewestFiling, TotalFilings )
     ;

     SELECT '
FormOldest FilingLatest FilingNbr Of Filings
'||A.Form||''||A.OldestFiling||''||A.NewestFiling||''||A.TotalFilings||'
'||A.Form||''||A.OldestFiling||''||A.NewestFiling||''||A.TotalFilings||'
' (TITLE '');

Ed



     
  <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