天天看點

建立時空表

if not exists(select * from sysobjects where name='zdbc_ypda')

create table zdbc_ypda (

  dabh char(25) null default '',

  rq char(10) null default '',

  spmch char(60) null default '',

  tongym char(40) null default '',

  shpgg varchar(30) null default '',

  jixing char(20) null default '',

  youxq char(10) null default '',

  zhilbz char(80) null default '',

  pizhwh char(36) null default '',

  cunchtj char(20) null default '',

  gllb char(30) null default '',

  shengccj char(60) null default '',

  jdmd char(200) null default '',

  ypbz char(200) null default '',

  ypbg char(200) null default '',

  ypzh char(200) null default '',

  ypyh char(200) null default '',

  ypblfy char(200) null default '',

  spid char(11) null default '',

  username char(12) null default '',

  djbh char(15) null default '',

  djlx char(4) null default '',

  djbs char(3) null default '',

  createtime char(20) null default ''

);

if not exists(select * from tblist where tbname='zdbc_ypda')

insert into tblist (tbname,chnname,tbtype)

   values ('zdbc_ypda','藥品檔案表','業務表');

delete from tbstru where tbname='zdbc_ypda';

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',1,'dabh');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',2,'rq');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',3,'spmch');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',4,'tongym');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',5,'shpgg');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',6,'jixing');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',7,'youxq');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',8,'zhilbz');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',9,'pizhwh');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',10,'cunchtj');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',11,'gllb');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',12,'shengccj');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',13,'jdmd');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',14,'ypbz');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',15,'ypbg');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',16,'ypzh');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',17,'ypyh');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',18,'ypblfy');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',19,'spid');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',20,'username');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',21,'djbh');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',22,'djlx');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',23,'djbs');

insert into tbstru (tbname,xlh,fdname) values ('zdbc_ypda',24,'createtime');

if not exists(select * from fldlist where fdname='gllb')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('gllb','管理類别','字元',30,0);

if not exists(select * from fldlist where fdname='jdmd')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('jdmd','建檔目的','字元',200,0);

if not exists(select * from fldlist where fdname='ypbz')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('ypbz','藥品包裝标簽說明書','字元',200,0);

if not exists(select * from fldlist where fdname='ypbg')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('ypbg','藥品變更情況','字元',200,0);

if not exists(select * from fldlist where fdname='ypzh')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('ypzh','藥品召回情況','字元',200,0);

if not exists(select * from fldlist where fdname='ypyh')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('ypyh','藥品養護情況','字元',200,0);

if not exists(select * from fldlist where fdname='ypblfy')

insert into fldlist (fdname,chnname,fdtype,fdsize,fddec) values ('ypblfy','藥品不良反應情況','字元',200,0);