title: Check whether a tables exist or not on another schema - ORACLE DB
body: <p>I've a stored procedure created by EMP_DBA and part of the query will check whether the existing tables exist or not, if exist then drop table. This query works fine if I connect as EMP_DBA, now I want to run this stored procedure with other account let say USER1 and I've grant all the necessary rights to USER1. How to rewrite below statement in order count return 1 if the table MARKET_DATA exist in schema EMP_DBA ? </p>
  
  <pre><code>BEGIN 
  SELECT COUNT(*) INTO c
  FROM all_tables
  WHERE
  table_name = 'MARKET_DATA' AND OWNER = 'EMP_DBA';
  
  IF C = 1 THEN
  EXECUTE IMMEDIATE 'DROP TABLE MARKET_DATA';
  --exception when others then null; 
  END IF;
  </code></pre>