Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 02 Aug 2005 @ 07:18:37 GMT


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


Subj:   Re: Collect Stats in a Procedure
 
From:   Dieter Noeth

Srikanth Goli wrote:

  I thought, I could not collect stats in a procedure, so I created a macro.  


Why did you think so?

Did you receive an error message?

"User is not authorized to use the DDL/DCL/Dynamic SQL statement."

  but now, I realize I cannot invoke the macro from the procedure either. Wondering how other users achieve this (Collect stats on a table in a procedure) ?  


I just write collect statistics within the SP ;-)

IIRC it's allowed since V2R5.

     create procedure dropme()
     begin
        collect statistics on customer_service.employee column employee_number;
     end;

From the manuals:

You can use the following SQL Data Definition Language (DDL) statements in a stored procedure when the creator is also the immediate owner of the procedure. That is, a stored procedure can contain DDL statements only if it is created in the database of the user.

The Teradata Database supports the following SQL DDL statements for stored procedures:

          ...
          o COLLECT STATISTICS

Dieter



     
  <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