Puas yog Oracle muaj qhov pib nce ntxiv?
Puas yog Oracle muaj qhov pib nce ntxiv?

Video: Puas yog Oracle muaj qhov pib nce ntxiv?

Video: Puas yog Oracle muaj qhov pib nce ntxiv?
Video: Deev tas tua pov tseg scary story 4/4/2020 2024, Kaum ib hlis
Anonim

Thaum koj txhais ib kem hauv MySQL, koj tuaj yeem qhia qhov parameter hu ua AUTO_INCREMENT . Tom qab ntawd, thaum twg tus nqi tshiab tso rau hauv lub rooj no, tus nqi muab tso rau hauv kab no yog 1 siab dua tus nqi kawg. Tab sis, Oracle ua tsis yog muaj ib AUTO_INCREMENT feature.

Tsis tas li ntawd, peb puas tuaj yeem siv nws pib nce hauv Oracle?

2 Txoj Kev Tsim Auto nce Kum In Oracle (Primary Key) Peb ua tau tsim Auto nce kab hauv oracle los ntawm kev siv IDENTITY kab hauv Oracle 12c ib. Thiab hauv Oracle Database tsis muaj ib qho uas tshwm sim rau auto nce kem nqi nyob rau hauv lub rooj schema mus txog rau thaum Oracle 12c (mid 2014).

Qhov thib ob, Kuv yuav pib nce ib kab hauv SQL Developer li cas? Txoj nyem rau ntawm lub rooj thiab xaiv "Kho kom raug". Hauv "Hloov" Table window, xaiv " kab ", thiab tom qab ntawd xaiv koj PK kem . Mus rau Identity Kem tab thiab xaiv "Tshwj xeeb raws li Tus Kheej" raws li Hom, muab 1 hauv ob qho tib si pib nrog thiab increment teb . Qhov no yuav ua qhov no kem auto increment.

Ib yam li ntawd, nws tau nug, nws pib nce Oracle yog dab tsi?

Autoincrement Primary Key rau Oracle . Feem ntau cov databases muaj ib kem autoincrement attribute los yog ib autoincrement hom ntaub ntawv. Lawv yog siv los tsim cov cim tshwj xeeb rau ib kab. Hauv Oracle , koj yuav tsum siv ib tug Sequence ua ke nrog ib tug Trigger kom tau ib tug autoincrement kem.

Auto increment yog dab tsi?

Auto nce yog ib txoj haujlwm uas ua haujlwm ntawm cov ntaub ntawv tus lej. Nws cia li tsim cov lej ua ntu zus txhua zaus uas cov ntaub ntawv tau muab tso rau hauv ib lub rooj rau ib daim teb uas txhais tau tias auto nce.

Pom zoo: