I am trying to write a script which allows a user to select the what manipulation he needs to do on a table. I want to check if the table exists or not. If it exists I will continue the other things or else I exit saying table doesn't exist. How might I achieve this.
These queries should help you...
select owner, table_name from all_tables;
select table_name from user_tables;
Use where
clauses, store the result in variable. take table as user input and then run the query.
vSQLResult=`sqlplus -s DBUID/DBPASS@SCHMA <<EOF
set pages 0
set head off
set feed off
<<Your DB queries goes here>>
exit
EOF`
You can do more R&D with above suggestion.