Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.gamma.ru!Gamma.RU!news2.volia.net!koehntopp.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Tue, 06 Jun 2006 16:05:47 +0200 From: Maxim Demenko Reply-To: mdemenko@gmail.com User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 Newsgroups: comp.databases.oracle.misc Subject: Re: Passing integer values from shell script to a .sql file References: <1149602011.892794.319880@h76g2000cwa.googlegroups.com> In-Reply-To: <1149602011.892794.319880@h76g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Lines: 60 Message-ID: <44858d15$0$11064$9b4e6d93@newsread4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 06 Jun 2006 16:11:33 MEST NNTP-Posting-Host: 5944b51a.newsread4.arcor-online.net X-Trace: DXC=kdJk;D\EC2NO@oM:dhE>=@:ejgIfPPldDjW\KbG]kaMH]kI_X=5KeaFUFLbKJCYDlA?260c7o_eEJfb[YG8XaEeH]3KZ57eK;;A X-Complaints-To: usenet-abuse@arcor.de Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:127775 anju schrieb: > Hi All, > > i'm facing the below problem in passing integer values. > > > ------------------------------------------------------- > $ ./ex5.sh > insert into emp values ($1,'$2',$3,'$4') > * > ERROR at line 1: > ORA-00911: invalid character > ------------------------------------------------- > > Script > > ========================== > $cat ex5.sh > #!/usr/bin/bash > > # this is a sample file to insert data into a table > > USERNAME="system" > PASSWD="passwd" > SID="orcl" > declare -i val1=102 > val2="tom" > declare -i val3=40000 > val4="boston" > > # database connection and updation. > > sqlplus -s $USERNAME/$PASSWD < @"/home/abc/second.sql" $val1 $val2 $val3 $val4 > EOF > ======================================== > > SQL file > > ++++++++++++++++++++++++ > insert into emp values ($1,'$2',$3,'$4') > / > ++++++++++++++++++++++++ > > > > How can i pass integer values to the sql script. > > > Thanks in advance, > an > cd /home/abc sed 's/\$/\&/g' second.sql > second_new.sql mv second_new.sql second.sql Best regards Maxim