select
*
from
(
select
case
when
object_type =
'VIEW'
then
'view'
when
object_type =
'PROCEDURE'
then
'procedure'
when
object_type =
'PROCEDURE'
then
'function'
when
object_type =
'SEQUENCE'
then
'sequence'
when
object_type =
'TYPE'
then
'type'
when
object_type =
'TABLE'
then
'table'
end
AS
object_group
,
case
--when object_type = 'VIEW' then 'drop view '||object_name||';'
--when object_type = 'PROCEDURE' then 'drop procedure '||object_name||';'
--when object_type = 'PROCEDURE' then 'drop function '||object_name||';'
--when object_type = 'SEQUENCE' then 'drop sequence '||object_name||';'
--when object_type = 'TYPE' then 'drop type '||object_name||';'
when
object_type =
'TABLE'
then
'drop table '
||object_name||
';'
end
AS
object_drop_sql
from
user_objects
order
by
decode(object_type,
'VIEW'
, 0,
'PROCEDURE'
, 1,
'FUNCTION'
, 2,
'SEQUENCE'
, 3,
'TYPE'
, 4,
'TABLE'
, 5)
)
where
object_drop_sql
is
not
null
;
'Programming > DataBase' 카테고리의 다른 글
[Mysql] oracle의 START WITH CONNECT BY 구문을 mysql로 구현하기 (0) | 2015.07.07 |
---|---|
[oracle] 데이터 개별 일괄 업데이트 (0) | 2015.06.17 |
[Mssql] insert 한 seq 값 select 해오기 (0) | 2015.04.28 |
[mssql] 현재날짜 yyyy-dd-mm (0) | 2015.03.06 |
[MSSQL] 계층형 트리구조 쿼리 (0) | 2015.02.03 |