The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Accessing PL/SQL OUT variables in Korn Shell Script bright_future UNIX for Advanced & Expert Users 4 1 Day Ago 09:02 AM
Accessing Shell Variables in awk or sed nasersh Shell Programming and Scripting 3 05-05-2008 04:44 AM
Accessing Variables from .conf file wayne1411 Shell Programming and Scripting 7 01-30-2008 01:30 PM
accessing ksh variables from awk trupti wagh Shell Programming and Scripting 1 02-26-2007 01:11 AM
accessing variables declared in another perl script gurukottur Shell Programming and Scripting 3 11-09-2006 06:22 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2008
Registered User
 

Join Date: Dec 2006
Location: hyderabad
Posts: 102
accessing unix variables in oracle

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
Reply With Quote
Forum Sponsor
  #2  
Old 02-06-2008
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,019
'man ksh' yields the foowing for the 'here-document':
Code:
     << [-]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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0