Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Turn off ORA errors in sql script

Oracle_WalkerJul 31 2012 — edited Aug 1 2012
All,

I execute a sql select statement from bash script like the below one,
string="user/pass@tns"
tot=`sqlplus -s $string << EOF
set echo off
set feedback off
set head off
select count(*) from test_table;
EOF
`
This assigns total from test_table to shell variable tot. Now i get the below ORA erro when executing this
script
ERROR: ORA-28002: the password will expire within x days
Now the variable tot is assigned with total count from test_table + ERROR: ORA-28002: the password will expire within x days.
I need a way to get only the total rows count alone without any string, will set command help here? or need to go for another way
This post has been answered by BluShadow on Jul 31 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2012
Added on Jul 31 2012
13 comments
1,613 views