![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Updating table on UNIX server using SFTP | Pallavi_gondkar | UNIX for Dummies Questions & Answers | 1 | 04-04-2008 02:47 AM |
| First Script: Query every table with column xxx. | Iniquity | Shell Programming and Scripting | 1 | 02-06-2007 01:15 PM |
| Store return code of shell script in oracle table | sveera | Shell Programming and Scripting | 3 | 05-04-2005 10:25 AM |
| updating a column in a unix table for a particular row | thanuman | Shell Programming and Scripting | 4 | 04-26-2005 04:59 AM |
| update a oracle table using shell script | ann_124 | Shell Programming and Scripting | 2 | 12-18-2004 04:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi friends,
i am having a variable declared in .profile.i am changing its value in a shell script and then i am connecting to oracle and then from there i am calling a .sql called update.sql STATUS is the variable declared in the .profile =============================== if [ $STATUS -eq 1 ] sqlplus <<END username/password@connectstring @update.sql commit; but how to i pass the value of the $STATUS to the .sql ? this value has to go into a column in a table. Please help thanks in advance Veera |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
You can specify STATUS value as &1 in update.sql file and call the script as
@update.sql $STATUS or @update.sql 1 as the script is called only if STATUS is equal to 1 |
|
#3
|
|||
|
|||
|
Hi SSSROW,
Thanks for the reply but it doesnt help me. the update is not taking place. it says zero rows updated. Please help out. thanks Veera |
|
#4
|
|||
|
|||
|
sssow's post should accomplish what you are requesting. Can you provide your update.sql script? It should look something like this:
Code:
-- update.sql update yourtable set status=&1 where whatever='some key value'; Code:
if [ $STATUS -eq 1 ] sqlplus <<END username/password@connectstring @update.sql $STATUS commit; END |
|||
| Google The UNIX and Linux Forums |