Oracle在存储过程中,如何删除和创建表?
2007-04-17 11:37 flyingfish 阅读(4630) 评论(1) 编辑 收藏 举报
参考:
create or replace procedure replace_table_wz_property
authid current_user
as
str1 varchar2(1000);
str2 varchar2(1000);
str3 varchar2(5000);
begin
str1 := 'truncate table wz_property';
str2 := 'drop table wz_property';
str3 := 'create table WZ_PROPERTY
(
PROPERTYID VARCHAR2(32) not null,
ADDRESS VARCHAR2(100),
RELEASEDATE DATE,
IDCARD VARCHAR2(50),
HOUSEHOLDER VARCHAR2(100),
AREA NUMBER(12,2)
)
tablespace USERS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 1M
minextents 1
maxextents unlimited
) ';
execute immediate str1;
execute immediate str2;
execute immediate str3;
end replace_table_wz_property;