Create a sequence comment primary key for a table 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 ';
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 a table TCAPITALNOTIFY */
Execute immediate 'create table TCAPITALNOTIFY (
Rochelle 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 ''funding notification table ''';
Execute immediate 'comment on column TCAPITALNOTIFY. L_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 ''institution 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 ''';
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 ''' creator ''';
Execute immediate 'comment on column TCAPITALNOTIFY. D_CREATEDATE is ''creation date ''';
End if;
END;
/

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

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.