RSH question

Is there a way to do an rsh from within a script and spans commands on multiple lines?

Ex.

rsh $host <<EOF
echo `hostname`
EOF

I get this error:
tcgetattr: Inappropriate ioctl for device
ioctl I_FIND ttcompat: Inappropriate ioctl for device
./t.script: EOF: command not found

At my old job we could do sql queries like this on KSH

var=`sqlplus -s <<-EOF
"query statement"
exit;
EOF`

I was wondering if I could do this with rsh. I am using a bash shell. Thanks.

as an example:

rsh $host 'sqlplus -s <<EOF
"query statement"
exit;
EOF'

The rsh command cannot be redirected input. rsh can only execute commands on remote systems.
The sqlplus command given by reborg will work as the sqlplus can take input from the terminal.

Hi reborg ..
a similar code to mine doesnt work :
vzs422:/in/tmp>su - linus rsh -l linus psmf 'sqlplus -s <<EOF
> select * from tab;
> exit;
> EOF'
OSF1
OSF1
End of linus's profile.
ksh: sqlplus: not found

Could you pls help ?