variables in Bteq

Database
Enthusiast

variables in Bteq

is there anyway in which variables can be used in teradata bteq

i want to store a value of a column from a table into a variable and use the variable where i need in the code

Thanks
2 REPLIES
Enthusiast

Re: variables in Bteq

hi,
As far as I know, the only way to store the value from table into variable is, to export the required data to a file and then read it from that file.
Hope this what u expect.

Enthusiast

Re: variables in Bteq

A simple way to have pseudo-variables in a bteq script is to use temporary tables...

[Code]CREATE VOLATILE TABLE mypseudovar
AS
SELECT myexpr AS varname
FROM myfirstrequest
WITH DATA;

SELECT var.myvar, req.what_i_want
FROM mysecondrequest AS req
CROSS JOIN
mypseudovar AS var
;[/Code]

I let you find extended usages