Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 11 Sep 2003 @ 19:22:05 GMT


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


Subj:   Re: Teradata Stored Procedures and Cursors
 
From:   Dennis Calkins

Hi,

I have had some ofline inquires so I thought I would post some more information here.

I am not saying to avoid stored procedures or even Stored procedures with Cursors if cursors is the only way to solve the query. Stored procedurs have their place.

The orginal concept of stored procedures was specifically to allow people to do some of the computing inside the box rather than transfering all the rows back to the client and process them there thus saving band with on the corporate network.

Stored procedures can have more than 1 DDL/DCL statements whereas MACROS can't. create tables, users, grants all in one neat package.

Stored procedure can handle RECURSIVE Queries. There is a nice example of this on the Teradata V2r5.0 Demo CD.

You can use Parameterized SQL for stuff like database and table names which you can't do in a macro.

Stored procedures can execute differnt LOGIC based upon the parameters.

      sel user into :myuser;
      if ( myuser == "BOB" )
            .
            .
            .
      if ( myuser == "JOHN" )
            .
            .
            .


     
  <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