![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed: how to insert tab? | Juha | Shell Programming and Scripting | 2 | 10-29-2007 07:15 AM |
| Insert line break in vi's command mode | Skogsmulle | UNIX for Dummies Questions & Answers | 3 | 07-06-2007 11:47 AM |
| unix command to insert double quotes | berlin_germany | Shell Programming and Scripting | 2 | 01-17-2007 01:07 PM |
| script to run shell command and insert results to existing xml file | littlejon | Shell Programming and Scripting | 5 | 08-12-2005 05:59 PM |
| awk command for INSERT statement | nattynatty | Shell Programming and Scripting | 4 | 05-10-2002 03:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sql insert command
Hi,
sqlplus -s / <<EOF > /dev/null insert into table1 (a1, a2, a3) values ('a',1,'b'); commit; EOF in the above code can i pass the values to the insert command from shell script like this: insert into table1 (a1, a2, a3) values ('$a',$b,'$c'); If yes, how is it passed?? Any help greatly appreciated. (I found some similar threads but culdn't find any particular soln to this) thanks, abey |
|
||||
|
The problem is that you require ' characters to delimit strings. Here is a workaround not using a here doc: Code:
userid=me
pswd=mypassword
command=$(
echo "$userid/$pswd"
printf "insert into table1 (a1, a2, a3) values ('%s','%s','%s');\n" $a $b $c
echo "commit;"
echo "exit")
echo "$command" | sqlplus -s
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|