orcale建表脚本

declare v_cnt number;
 V_SQL VARCHAR2 (500) := '';
begin
 select count(*) into v_cnt from dual where exists(SELECT * FROM  user_tables WHERE TABLE_NAME = UPPER('TB_FDN_STATIONHISTORYIMAGE'));
   if v_cnt> 0 then
    V_SQL := 'drop TABLE TB_FDN_STATIONHISTORYIMAGE';
    EXECUTE IMMEDIATE V_SQL;
end if;
end;
/
--------------------------------------------------------
--  DDL for Table TB_FDN_STATIONHISTORYIMAGE
--------------------------------------------------------

CREATE TABLE "TB_FDN_STATIONHISTORYIMAGE"
   (    "STATIONHISTORYIMAGE_ID" VARCHAR2(32 BYTE) DEFAULT sys_guid(),
    "ZDBH" VARCHAR2(32 BYTE),
    "ZDMC" NVARCHAR2(20),
    "CZBH" VARCHAR2(32 BYTE),
    "CZMC" NVARCHAR2(20),
    "IMGNAME" NVARCHAR2(100),
    "IMGSRC" NVARCHAR2(255),
    "IMGTYPE" NUMBER,
    "INSERT_USER" NVARCHAR2(20),
    "INSERT_DATETIME" DATE,
    "UPDATE_USER" VARCHAR2(20 BYTE),
    "UPDATE_DATETIME" DATE
   ) SEGMENT CREATION IMMEDIATE
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "BUSINESS_DATA" ;

COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."STATIONHISTORYIMAGE_ID" IS '主键';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."ZDBH" IS '站段编号';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."ZDMC" IS '站段名称';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."CZBH" IS '车站编号';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."CZMC" IS '车站名称';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."IMGNAME" IS '图片名称';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."IMGSRC" IS '图片路径';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."IMGTYPE" IS '图片类型';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."INSERT_USER" IS '增加人';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."INSERT_DATETIME" IS '增加时间';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."UPDATE_USER" IS '修改人';
 
   COMMENT ON COLUMN "TB_FDN_STATIONHISTORYIMAGE"."UPDATE_DATETIME" IS '修改时间';
--------------------------------------------------------
--  DDL for Index TB_FDN_STATIONHISTORYIMAGE_PK
--------------------------------------------------------

CREATE UNIQUE INDEX "TB_FDN_STATIONHISTORYIMAGE_PK" ON "TB_FDN_STATIONHISTORYIMAGE" ("STATIONHISTORYIMAGE_ID")
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "BUSINESS_DATA" ;
--------------------------------------------------------
--  Constraints for Table TB_FDN_STATIONHISTORYIMAGE
--------------------------------------------------------

ALTER TABLE "TB_FDN_STATIONHISTORYIMAGE" MODIFY ("STATIONHISTORYIMAGE_ID" NOT NULL ENABLE);
 
  ALTER TABLE "TB_FDN_STATIONHISTORYIMAGE" ADD CONSTRAINT "TB_FDN_STATIONHISTORYIMAGE_PK" PRIMARY KEY ("STATIONHISTORYIMAGE_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "BUSINESS_DATA"  ENABLE;

上一篇:Codeforces Round #345 (Div. 2) D. Image Preview 暴力 二分


下一篇:iOS错误之-Presenting view controllers on detached view controllers is discouraged