Hi,
consider the following script.
ip='***.***.**.'
user=''
pw=''
ftpresults=`ftp -nv $ip<<EOF
user $user $pw
cd /home/oracle/practice
size $1
bye
EOF`
fname=$1
echo $ftpresults
sqlplus -s tms/tms@dev45 <<"EOF"
insert into remote_file_sizes (file_name,file_size) values ($fname,$ftpresults);
commit;
EOF
In the above script i am getting the size of a remote file through and i am inserting it into oracle table.
But i am not able to access the filename($fname)and filesize ($ftpresults) in insert statement.
can anybody tell me how to access these unix variables in oracle insert statement.
cheers
RRK
'man ksh' yields the foowing for the 'here-document':
<< [-]word
The shell input is read up to a line that is the same
as word, or to an EOF. No parameter substitution, com-
mand substitution, or file name generation is per-
formed on word. The resulting document, called a
here-document, becomes the standard input. If any
character of word is quoted, no interpretation is
placed upon the characters of the document. Otherwise,
parameter and command substitution occur, \NEWLINE is
ignored, and \ must be used to quote the characters \,
$, `, and the first character of word. If - is
appended to <<, then all leading tabs are stripped
from word and from the document.