/**创建表的过程
如果表存在,则删除再创建
否则直接创建
*/
declare
tabCount number;
begin
--查询要创建的表是否存在
select count(1) into tabCount from user_tables where table_name='QUESTION';
--如果存在,则删除该表
if tabCount>0 then
dbms_output.put_line('表或视图不存在!');
execute immediate 'drop table QUESTION';
end if;
execute immediate 'create table question(
id number not null primary key,
title varchar(180) not null ,
start_date varchar(28) ,
end_time varchar(28)
)';
tabCount:=0;
end;