Re: sql*plus interactive in shell script

From: Nicolas Iselin <nicolas_at_iselin.ch>
Date: Thu, 13 Sep 2001 18:09:27 +0200
Message-ID: <3BA0DA37.EA474BD7_at_iselin.ch>


tom-12 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
>
> with this i get the string 'Title: ' in my log file but not prompt user ...
>

[Quoted] This is conventional Unix-Logic: You have redirected stdout to /file.log, and ACCEPT [Quoted] simply outputs some data to stdout (and therefore to /file.log). You have also [Quoted] redirected stdin to the here-document with the << symbol, so you will never have [Quoted] your title in the MYTITLE variable (I never used ACCEPT yet, but I think I have [Quoted] guessed right how it works...).

The only way to input data into an sqlplus that is using a here-document is to [Quoted] generate a data file with standard unix means and then reading that file with _at_filename from within the sqlplus here-document.

Nicolas Received on Thu Sep 13 2001 - 18:09:27 CEST

Original text of this message