oracle创建表/序列/注释/主键(转载)

17小时前 (05:50:16)阅读1回复0
dyyh
dyyh
  • 管理员
  • 注册排名7
  • 经验值73510
  • 级别管理员
  • 主题14702
  • 回复0
楼主

  DECLARE

  iCount number(2) := 0;

  BEGIN

  SELECT COUNT (*) INTO iCount FROM user_sequences u WHERE u.sequence_name = 'SEQ_TCAPITALNOTIFY';

  IF iCount = 0

  THEN

  /*创建序列 上海oracle培训landscaper-academy.com*/

  EXECUTE IMMEDIATE 'create sequence SEQ_TCAPITALNOTIFY minvalue 1 nomaxvalue start with 1 increment by 1';

  END IF;

  SELECT COUNT (*) INTO iCount FROM user_tables u WHERE u.TABLE_NAME = 'TCAPITALNOTIFY';

  IF iCount = 0

  THEN

  /*创建表TCAPITALNOTIFY*/

  EXECUTE IMMEDIATE 'create table TCAPITALNOTIFY(

  L_SERIALNO number(11) not null primary key,

  D_DATE DATE not null,

  C_CUSTNO varchar2(12) not null,

  F_BALENCE NUMBER(16,2),

  C_FUNDCODE VARCHAR2(6),

  D_REPLYPAYTIME DATE,

  C_ORGCONTACT VARCHAR2(2000),

  C_ORGTEL VARCHAR2(2000),

  D_NOTIFICATIONTIME DATE,

  C_ISCERTIFICATE CHAR(1),

  C_REALPAYTIME DATE,

  C_MEMO CHAR(1),

  C_ISCANCEL VARCHAR2(2000),

  C_CREATOR VARCHAR2(16),

  D_CREATEDATE DATE

  ) nologging tablespace crm_htable';

  EXECUTE IMMEDIATE 'comment on table TCAPITALNOTIFY is ''资金通知情状表''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.L_SERIALNO is ''序列号''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.D_DATE is ''日期''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_CUSTNO is ''账户名称''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.F_BALENCE is ''购置资金(元)''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_FUNDCODE is ''购置产物''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.D_REPLYPAYTIME is ''机构回答资金划拨时间''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_ORGCONTACT is ''机构联络人''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_ORGTEL is ''机构联络德律风''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.D_NOTIFICATIONTIME is ''我方通知时间''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_ISCERTIFICATE is ''能否供给划款凭证''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_REALPAYTIME is ''资金现实到账时间''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_ISCANCEL is ''撤单''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_MEMO is ''备注''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.C_CREATOR is ''创建人''';

  EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY.D_CREATEDATE is ''创建日期''';

  END IF;

  END;

0
回帖

oracle创建表/序列/注释/主键(转载) 期待您的回复!

取消