Pass Variables from Shell to SQLPlus ??
663605Jan 30 2009 — edited Aug 31 2009Hi all,
I need to know if it's possible to pass variables from a shell script to
sqlplus.
The script reads a Table Name from user input & executes a Select statement
based on
that input.
Script:
....
echo "Enter table name: \c "
read answer
sqlplus 'oracle/*** ' <<!
spool columns.sql
@select.sql
spool off
exit
!
Inside SELECT.SQL , i need to use the variable "answer" to run
the query.
( $answer doesn't do the job...?:| )
Any help would be highly appreciated.
Thanks in advance...
Edited by: Lynda M. on Jan 30, 2009 9:19 AM