global parameters or variables in Teradata?

Database

global parameters or variables in Teradata?

Does Teradata have global parameters or global variables?  I want to take a sample from a table where the sample size is a multiple of the number of rows in another, existing, table:

create table t2 AS(

   select top 360 *

   from t1

   )

with data primary index(keycol)

;

Where table t1 exists and has 120 rows.  But I do not want to hard code it in case t1 changes and has a different number of rows in a later run.

Can it be done?

1 REPLY
N/A

Re: global parameters or variables in Teradata?

You need a Stored Procedure using Dynamic SQL, Teradata simly doesn't allow a variable for TOP or SAMPLE.