Re: sql*plus interactive in shell script

From: Mark Styles <news_at_lambic.co.uk>
Date: Thu, 13 Sep 2001 16:29:41 GMT
Message-ID: <nhn1qtkddmhardtqvjicgcdmqdh29n7kfb_at_4ax.com>


On Thu, 13 Sep 2001 18:02:57 +0200, "tom-12" <tclavier_at_partner.auchan.com> wrote:

>how can write a sql*plus an interactive sql procedure in shell script ex:
>
>#!/bin/sh
>echo Start script
>...
>echo Start SQL
>sqlplus -s log/pass_at_foo<<EOF >/file.log
>ACCEPT MYTITLE PROMPT 'Title: '
>EOF
You can't use ACCEPT from within a here document, because STDIN is already redirected. Instead do something like:

#!/bin/sh
echo Start script

echo Start SQL
echo -n 'Title: '
read title
sqlplus -s a/b_at_c << EOF > /file.log
ttitle $title
EOF Received on Thu Sep 13 2001 - 18:29:41 CEST

Original text of this message