BTEQ- Assign Value to User Defined Variable.

Tools & Utilities
Enthusiast

BTEQ- Assign Value to User Defined Variable.

Hi,

Please can anyone advise how do i assign a value to a user defined variable inside a BTEQ Script.?

For Eg.

I need to assign 'abc' to a variable Name .?

How do i need to code this inside a BTEQ Script.?
How do i declare a User Defined Variable.?

1)One Way is to accept the varialble from other file?

But i dont want to use another file and take a variable directly inside the BTEQ Script.

Your help in this is highly appreciated.
3 REPLIES
Teradata Employee

Re: BTEQ- Assign Value to User Defined Variable.

Hello,

How about taking input in shell script and passing it to BTEQ script?

Regards,

Adeel
Enthusiast

Re: BTEQ- Assign Value to User Defined Variable.

Thanks Adeel for a prompt response,

I am not familiar with UNIX env.
But worked on mainframes,
I am currently trying the stuff on TD Demo Version on Windows.

I am able to accept variable from other file but need to avoid using file and code is
direclty inside the script.

Teradata Employee

Re: BTEQ- Assign Value to User Defined Variable.

Well I haven't tried it on Windows but it is do-able in UNIX. May be DOS script can be something useful.

Additionally, following may be of some help:

- Put a marker in place of variable in BTEQ script (e.g. SELECT * FROM $Var1$)
- Get input from DOS/Batch script (e.g. Table1)
- Find and replace "$Var1$" to "Table1" in BTEQ script
- Run the BTEQ script
- Find and replace "Table1" to "$Var1$"

HTH.

Regards,

Adeel