All Forums Tools
mukuljain015 1 post Joined 03/15
26 Mar 2015
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

ULICKERT 3 posts Joined 10/09
28 Mar 2015

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

MaximeV 19 posts Joined 11/13
14 Aug 2015

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

You must sign in to leave a comment.