일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- swift 화면전환
- 한글깨짐
- Android
- 블록코딩
- MS-SQL
- ASP.NET MVC
- 코딩입문
- Kakao API Address
- upbit
- PromptEngineering
- MYSQL
- MSSQL
- AIoptimization
- .csv
- 썸머노트
- league of legends
- python
- 중학생코딩
- cc챔피언
- 아이코딩습관
- chart.js
- 일본여행
- 엔트리
- 중1코딩
- Excel
- httpclient timeout
- 초딩수학
- largelanguagemodels
- Aspose.cells
- 오블완
Archives
- Today
- Total
DBA
Oracle에서 테이블 유무확인하고 있으면 테이블을 Drop하고 Create 하는 쿼리 구문 본문
728x90
반응형
SMALL
Oracle에서 테이블 유무확인하고 있으면 테이블을 Drop하고 Create 하는 쿼리 구문
역시, Oracle은 뭔가 복잡 하다.
[Oracle]
declare
i_cnt number;
begin
select count(*) into i_cnt from all_tables where table_name = 'TEST01';
if i_cnt > 0 then execute immediate 'drop table TEST01'; end if;
execute immediate 'create table TEST01 (b number(1))';
end;
[MS-SQL]
if exists (select 1 from sys.objects where object_id = object_id ('TEST01') and type in ('U'))
begin
drop table TEST01
end
create table TEST01 (b int)
728x90
반응형
LIST
Comments