Create a table/sequence/comment/primary key in oracle

Source: Internet
Author: User


DECLARE iCount number (2): = 0; begin select count (*) INTO iCount FROM user_sequences u WHERE u. sequence_name = 'seq _ TCAPITALNOTIFY '; www.2cto.com IF iCount = 0 THEN/* create sequence */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 = 'tcapital=y '; IF iCount = 0 THEN/* create table tcapital=y */execute immediate 'create table tcapital=y (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 '; www.2cto.com execute immediate 'comment on table TCAPITALNOTIFY is ''' capital notification ''; execute immediate 'comment on column TCAPITALNOTIFY. rochelle serialno is ''serial number '''; execute immediate 'comment on column TCAPITALNOTIFY. d_DATE is ''dat''; execute immediate 'comment on column TCAPITALNOTIFY. c_CUSTNO is ''account name'''; execute immediate 'comment on column TCAPITALNOTIFY. f_BALENCE is '''purchase funds (RMB) '''; EXECUTE IMMEDIATE 'comment on column TCAPITALNOTIFY. c_FUNDCODE is ''buy products'''; execute immediate 'comment on column TCAPITALNOTIFY. d_REPLYPAYTIME is ''institution reply fund transfer time '''; execute immediate 'comment on column TCAPITALNOTIFY. c_ORGCONTACT is ''Organization Contact '''; execute immediate 'comment on column TCAPITALNOTIFY. c_ORGTEL is ''organization contact number '''; execute immediate 'comment on column TCAPITALNOTIFY. d_icationicationtime is ''our notification time '''; execute immediate 'comment on column TCAPITALNOTIFY. c_ISCERTIFICATE is ''whether to provide the transfer credential '''; execute immediate 'comment on column TCAPITALNOTIFY. c_REALPAYTIME is '''actual receipt time of funds '''; www.2cto.com execute immediate 'comment on column TCAPITALNOTIFY. c_ISCANCEL is ''withdraw '''; execute immediate 'comment on column TCAPITALNOTIFY. c_MEMO is ''note''; execute immediate 'comment on column TCAPITALNOTIFY. c_CREATOR is ''created by '''; execute immediate 'comment on column TCAPITALNOTIFY. d_CREATEDATE is ''create date '''; end if; END; // from the columns of fujianianhua

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.