Merging of Bteq and shell scripts

Tools & Utilities

Merging of Bteq and shell scripts

I want to use shell variables in bteq commands and shell commands in bteq script. e.q  create table $variable (some xyz column list); and some sort of shell  commands within bteq scripts.

So can you please assit me in doing it.

Thanks

2 REPLIES
Teradata Employee

Re: Merging of Bteq and shell scripts

Hi,

you may just use a 'Here-script'

#!/usr/bin/ksh
LOGON='.logon $TDPID/$user,$tdwallet($user)'
variable='MYDatabase.MyTable'
bteq <<-END
create table $variable ( some xyz column list);
.remark $(date)
END

all UNIX-variables will be expanded before giving the text to bteq.

Hope it helps

Teradata Employee

Re: Merging of Bteq and shell scripts

ULICKERT : great help on this, was kinda blocked and didnt think of creating a variable for .logon command.

(that you forgot to call under your bteq  command )

thank you