Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Teradata Variables or Constants

Status
Not open for further replies.

mminor

Programmer
Mar 28, 2002
1
US
We recently converted our data into a teradata warehouse and off of a SQL Server. Code I had written prior to the conversion using Transact SQL utilized the Declare function in order to utilize variables. Ex. Declare @name varchar[10], where @name was a variable. I then could assign a value to the variable using Set @name = 'Michael'. I am trying to accomplish the same thing using teradata and am having severe troubles. Does anyone know a work around in teradata that would be similar to the Declare statement. Keep in mind that I do not have Create Table privileges to create a table of variables. Any help you can give me would be appreicated. Thank you.

Michael Minor
 
Hi Michael,

Are you attempting to do this in SQL, a stored procedure, a macro, or perhaps some other (external to DB) language... The approach taken obviously depends on the environment being used.

What is the purpose of the variable you are attempting to define? If it is just a parameter to some SQL I suggest you use macros. If it is part of a complex transformation you might want to have a go at using stored procedures. Of course either of the above would require the appropriate create privs, and if you don't have create table it is likely you will not have create macro or SP...

Regards,

TeraOz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top