Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

passing ksh variable into bteq function? - forum topic by k1ng

$
0
0

I'm trying to pass string variables inside a function (the bteq itself does work) but can't seem to get it to work. I try this:

td_instance="one"
user="usr1"
pass="pass1"
schemaName="schemaA"
tblName="tableA"
query="SEL '>'||COUNT(*) FROM $schemaName.$tblName"

query_td() {bteq .LOGON $td_instance/$user,$pass
DATABASE $schemaName;
.set width 1000;
.set titledashes off;
$1;
.LOGOFF;
.QUIT;
.EXIT
}

echo $(query_td << EOF |grep '^>' |sed -e "s/^>//" EOF "$query")

and keep getting this error:

-ksh: .: syntax error: `)' unexpected

can someone help me pass the variables into the bteq function?

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>