1. Add a comment to the SQL
Comment on table tableName is ' table note ';
Comment on column tablename.columnname is ' field comment description ';
Comment on table t_cif_ehrlog is ' EHR synchronization log table ';
Comment on column t_cif_ehrlog.id is ' serial number ';
Comment on column t_cif_ehrlog.syn_date was ' synchronized (yyyy-mm) ';
Comment on column t_cif_ehrlog.interface_type is ' interface type (encoded) (Ehrcompanyimpl company information; Ehrdeptimpl Department information; Ehrpositionimpl position information; I MPL basic information; Ehrnationalimpl document information; Ehrbirthdayimpl birthday information; Ehrphoneimpl telephone information; Ehrorganizationimpl agency information;) ';
Comment on column t_cif_ehrlog.create_date is ' storage time (yyyy-mm-dd hh24:mi:ss) ';
Comment on column t_cif_ehrlog.update_date is ' Update time (yyyy-mm-dd hh24:mi:ss) ';
Comment on column t_cif_ehrlog.is_success is ' state (0: Success 1: failed) ';
Comment on column t_cif_ehrlog.error_message is ' failure description ';
2. Create the SQL for the Federated primary key
--ehr Synchronization Log Table
CREATE TABLE T_cif_ehrlog
(Id number is not NULL,
Syn_date VARCHAR2 () NOT NULL,
Interface_type VARCHAR2 (+) NOT NULL,
Create_date date NOT NULL,
Update_date date,
Is_success VARCHAR2 (1) NOT NULL,
Error_message VARCHAR2 (1000),
CONSTRAINT Pk_sin
Primary KEY (Syn_date,interface_type)
);
Description
Primary key: A property in a table that can uniquely determine a tuple. (The popular explanation is that a primary key is a combination of columns or columns that can uniquely determine a record.) Its role is to be able to accurately locate a record.
The Federated primary key is also used to accurately locate the unique records in a table, typically in many-to-many cases.