This discussion is archived
13 Replies Latest reply: Aug 1, 2012 6:34 AM by Oracle_Walker RSS

Turn off ORA errors in sql script

Oracle_Walker Newbie
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points