Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 03 Nov 2004 @ 21:02:32 GMT


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


Subj:   Re: Parameterizing SQL scripts
 
From:   Dempsey, Mike

If you have SQL Assistant you can do 1 of 2 things depending on how many of these you need to run, if the values are known (available) ahead of time, and what type of statement it is.

#1: Use named parameters (Requires SQL Assistant 6.2)

eg. Select * from ?Tbl

When you execute this you will be prompted to enter a value for 'Tbl' which can be of the form 'MyTable' or 'MyDB.MyTbl', or even include a where clause etc.

#2: Use Import mode

You can not use this method to substitute a table name if it is a Select, Insert, Update, or Delete statement. (Real parameterized sql is generated in these cases and table names are not legal parameters.)

You can use it for Create statements, Collect/Show statements etc. however. (Any statement except the 4 above.)

The statement will be executed once for each line in your Import file. The values in the import file will be substituted for the parameters in the query - indicated by ? characters.)


Mike dempsey
Teradata Client tools



     
  <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