SQL Collection (Oracle Version) (continuously updated ...)

xiaoxiao2021-03-06  72

1, self-increase: create sequence seq_nameincrement by 1start with 1maxValue 999999;

INSERT INTO TABLE_NAME (ID, ...) VALUES (seq_name.nextval, ...)

2, add constraints in existing tables

ALTER TABLE HASH_PRODUCTS ADD (constraint products);));

Alter Table A Add Check (COL1 IN (1, 2, 3, 4)) Enable noValidate; // Because there is already data in the table, it does not check the existing data, only the recorded records of increasing or modified.

3. Implement two tables synchronization (table in different databases)

Create syntax: Create Database Link LinkNameConnect To UserIdentified by usrpwd using 'Demona';

Where -Demona is set to false restart database settings in the init.ora file created with Net8 Easy Config's connections database.

转载请注明原文地址:https://www.9cbs.com/read-121213.html

New Post(0)