Variables

Tools

Variables

Hi,

I am very new to SQL and Teradata, just wondering if there is a way to use variables?

I have a bit of code that uses the same date at different points in the code, and it would be useful if I can replace these with variables.

Any help would be appreciated

Thanks
2 REPLIES
N/A

Re: Variables

How do you execute that "bit of code" ?
If Bteq / Unix, use Unix variables and SQL code as an "here document" (refer to your shell)
Pure SQL answer : create a temp table to hold your variables/values and use it in your requests.

Re: Variables

I am using Teradata SQL assistant in windows NT4 (sad I know!!)....I hope this answers your first question?

If the solution is to create a temp table would it be possible to give me a bit if guidance how to do this?? The tables that I am querying are the back end of a system we use, and I can't make tables on that server, but if it can done locally that would be great.

Thanks again