존재합니다. 여기 좀 도와 줄 수 있니?드롭 만약 내가 그, NETEZZA</strong><strong>에 그런 뭔가가있는 경우 테이블을 삭제하는 명령을 필요 네티
2
A
답변
3
가 내장 아무것도 없다,하지만 당신은 테이블을 드롭하기 전에 존재하는지 확인하기 위해 카탈로그 뷰를 사용하는 저장된 프로 시저 만들 수 있습니다 netezza
에서
create or replace procedure maybe_drop(varchar(128))
returns boolean
language nzplsql
as
begin_proc
declare
oname alias for $1;
o record;
begin
select otype into o
from (
select 'TABLE' otype from _v_table where tablename = upper(oname)
union all
select 'VIEW' otype from _v_view where viewname = upper(oname)
) x;
if found then
execute immediate 'DROP '||o.otype||' '||oname;
end if;
end;
end_proc;
12
는이 구문을 사용 할 수 있습니다 :
drop table table_name if exists;
+0
이것은 [docs] (https://www.ibm. com/support/knowledgecenter/SSULQD_7.2.1/com.ibm.nz.dbu.doc/r_dbuser_drop_table.html) 7.2.0부터 시작하십시오. – Niederee
왜 누구가 투표합니까? – Harry