I dont know about the db connection and execution of sql commands, but it seems that you are passing the my.sql itself as a parameter file to the dbaccess command.
HERE and echo example to expand value of variable using some kind of "template":
x=111
# here
cat <<EOF
select * from table where col1 = '$x' and col2 = 'text';
EOF
# normal command line expansion. ' ' are inside " " = only characters without special meanings
echo "delete from table where col1 = '$x' and col2 = 'text';"
I'm not used dbaccess cmd, but something like:
x=111
dbaccess args <<EOF
select * from table where col1 = '$x' and col2 = 'text';
EOF
dbaccess args <<EOF > output.result.file
select * from table where col1 = '$x' and col2 = 'text';
EOF
#or
echo "delete from table where col1 = '$x' and col2 = 'text' ; " | dbaccess args > output.result.file
dbaccess <<EOF
select * from table col1 in ( $(cat inputfile) ) and col2 = 'text';
EOF