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?
Tags:
Forums: