Passing Shell Variables in ISQL

Hi..

I am passing a variable in my shell function. I need to access it for an isql comand in the shell script.

However the isql o/p gives no results if i pass a variable in the command. The isql command works perfectly fine if i hardcore the table name.

My script is :

log=/home/../log/txt

LengthCheck()
{
tablename=$1

isql -S<server> -U<user> -P<pass> -D <db> -o $log << EOF
SELECT length,type from syscolumns
WHERE id = object_id("$tablename")
EOF

..
..
..
}

LengthCheck Employee

plz help..

Thanks,
dikki