Passing sql as parameter to unix function

Hi,

I have a function which connects to the db and runs the sql.
it works fine when I run it like: function "select empname from emp;"

but when I try to pass the sql string to a variable which in turn in fed to the function , it throws error.

please advise.

Thanks,
Arnie.

Need more info. What system? What shell? What database? What is the code and the error?