Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 25 Nov 2002 @ 15:55:02 GMT


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


Subj:   No data returned when executing a Teradata macro from within an MS Excel macro?
 
From:   McBride, Michael

I could use some help getting data from a Teradata SQL macro into an excel spreadsheet. The sql macro AEO_PRODSTAT.ANALYZE_PERF returns 24 rows, one for each hour of the day, and has two parms, a "start" and "end" date. When I try to populate an open excel worksheet. The SQL is executed, but the data result set is not displayed (MS Query is the same, it executes the code, but does not populate the data grid). The Teradata macro works fine in QueryMan and always returns the expected 24 rows...Can anyone spot what I'm doing wrong with the Excel macro????

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 11/22/02 by McBrideM
'

'
 With ActiveSheet.QueryTables.Add(Connection:= _
        "ODBC;DRIVER={Teradata};UID=;PWD=;DBCNAME=AEO_PROD;DATABASE=aeo_prodstat; ", Destination:= _
        Range("A1"))

        .Sql = Array( _
        " EXEC AEO_PRODSTAT.ANALYZE_PERF('2002-11-03','2002-11-30'); ")
        .FieldNames = False
        .RefreshStyle = xlInsertDeleteCells
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .RefreshOnFileOpen = False
        .HasAutoFormat = True
        .BackgroundQuery = True
        .TablesOnlyFromHTML = True
        .SavePassword = True
        .SaveData = True
    End With

End Sub

Any help is appreciated,

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



     
  <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