This discussion is archived
1 Reply Latest reply: Dec 8, 2013 7:50 AM by Anar Godjaev RSS

drop table in the schema

959406 Newbie
Currently Being Moderated

Hi

 

one of the interview question

 

in this schema contain

 

schema name  HRR

 

procedure -10

function -10

table 1000

 

how to detele HRR schema in 1000 table

 

plz send me command

  • 1. Re: drop table in the schema
    Anar Godjaev Expert
    Currently Being Moderated

    HI,

     

    If you mean only table:

     

    select 'drop table '||table_name||' cascade constraints;' from all_tables where owner='HRR';

     

    OR

     

    select 'drop table ' || owner || '.' || table_name || ' cascade constraints; ' from all_tables where owner='HRR'

     

     

    Spool the result of this query and execute it...

Legend

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