Shell SQLPlus


 
Thread Tools Search this Thread
Top Forums Programming Shell SQLPlus
# 1  
Old 11-13-2009
Question Shell SQLPlus

Hi,

I am trying to execute the update statment in shell sqlplus.But nothing prompts.if i do ctrl+c i got the below error.

SQL> update table set enabled='N' where type_code='xx';
^C update table set enabled='N' where type_code='xx'
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation.

if i use select statement records are retrived,
is it i need any access permissions...if so how to give that
can anyone advice this.
# 2  
Old 11-13-2009
Code:
echo "Enter value1: \c"
read value1
# assume value needs to a be '  ' delimited string
printf "'%s'" "$value" | read string
echo "Enter value2: \c" 
read value2
# assume value two is a number; no  ' ' is needed
sqlplus me/mypassword@someplace << EOF > logfile
set feedback on
update table set enabled= $value2 where type_code= $string;
commit;
exit;
EOF

I am guessing this is what you wanted.
# 3  
Old 11-13-2009
nmahendran,
your update statement is still running or waiting when you cancel it.
Try to find out if any other session is holding locks on that table, what size that table is and how many rows would be affected by your update.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sqlplus shell

friends because when calling a sqlplus from a shell it brings me the following message sqlplus -s $BDDUSER/$BDDPASS@$BDDHOST @$DIR_SQL/prueba.sql echo "bandera 3 " $? STATUS=$? if ;then echo "bandera 4 " $? #log_info "La ejecucion de... (1 Reply)
Discussion started by: tricampeon81
1 Replies

2. Shell Programming and Scripting

Sqlplus in shell script

Hi All, Please let me know what i am missing in the following code (part of my script) Schemas=(AWQM WFCONTROLLER PROVCO PRISM) for s in "${Schemas}" do sch="${s}_$tol" if || ;then echo "This is AD or TD region" sqlplus -s $sch/$tpwd@$ttns <<EOF... (7 Replies)
Discussion started by: pvmanikandan
7 Replies

3. Shell Programming and Scripting

Running sqlplus for 5 DB in a shell

Hi all, on AIX 6.1 I want to run the following but for 5 DB. How should I do that ? Using FOR, WHILE ???? How ? export ORACLE_SID=DB1 sqlplus / as sysdba << EOF whenever sqlerror exit sql.sqlcode; whenever oserror exit FAILURE set define off set head off set feedback off set echo off... (1 Reply)
Discussion started by: big123456
1 Replies

4. Shell Programming and Scripting

sqlplus in shell script

Hi When I use sqlplus in shell script, I get sqlplus: command not found. ORACLE_HOME is not set. How to set ORACLE_HOME in unix? Thanks (3 Replies)
Discussion started by: vinoth_kumar
3 Replies

5. Shell Programming and Scripting

SQLPLUS within shell script

Hi I want to connect to the Oracle database using a username/password and get back the query result(a numeric value) in a variable, which I can then compare using a conditional. Can anybody help me with this. Thanks Gaurav (4 Replies)
Discussion started by: gaurav_1711
4 Replies

6. UNIX for Dummies Questions & Answers

Switch from SQLPlus to shell?

What is the command for when you are in SQLPlus and want to go back to the shell prompt without actually exiting SQLPLus? Thanks. (2 Replies)
Discussion started by: Sepia
2 Replies

7. UNIX for Dummies Questions & Answers

Shell Script And SQLPLUS

i'm having real problems retrieving the returncode of my sqlplus-call. I found a lot of informations on the net, but havn't been able to get it running so far, so now i ask for some help ;) I do start the sqlplus out of my shell script with the parameters stored in the proc_clips.sql, which is... (6 Replies)
Discussion started by: maco_home
6 Replies

8. Shell Programming and Scripting

connect to sqlplus from shell

I'm writting a shell script and at the begining I login to sqlplus by sqlplus -l user_name/password@instance what I would like is to check if the database is down or not , and if the database has started moved to the next step else sleep for a certain time and then check again . I know how to... (4 Replies)
Discussion started by: aya_r
4 Replies

9. Shell Programming and Scripting

calling sqlplus from shell

Hi All, I am executing the following code :- sqlplus -s ${DATABASE_USER} |& print -p -- 'set feed off pause off pages 0 head off veri off line 500' print -p -- 'set term off time off serveroutput on size 1000000' print -p -- "set sqlprompt ''" print -p -- "SELECT run_command from... (2 Replies)
Discussion started by: suds19
2 Replies

10. UNIX for Dummies Questions & Answers

sqlplus and shell scripting

i would like to learn how to integrate my little knowledge in shell scripting with sqlplus. well... i know how to make basic query in sqlplus but i dont know how i can integrate it with shell script. can someone :) please help me on this? can you give me some basic example on how to do this kind of... (10 Replies)
Discussion started by: inquirer
10 Replies
Login or Register to Ask a Question