Cov txheej txheem:

Koj teeb tus yuam sij txawv teb chaws hauv Oracle SQL Developer li cas?
Koj teeb tus yuam sij txawv teb chaws hauv Oracle SQL Developer li cas?

Video: Koj teeb tus yuam sij txawv teb chaws hauv Oracle SQL Developer li cas?

Video: Koj teeb tus yuam sij txawv teb chaws hauv Oracle SQL Developer li cas?
Video: niam tais vab part4 10/4/2018 2024, Kaum ib hlis
Anonim

Nrhiav koj lub rooj uas koj xav tau tsim kom muaj Foreign Key thiab ua txoj cai nyem rau ntawm nws. Los ntawm cov ntawv qhia zaub mov shortcut xaiv Kev txwv > Ntxiv Foreign Key . Ib Add Foreign Key qhov rai yuav tshwm. Hauv thawj daim teb, nws yuav qhia koj lub npe Schema (neeg siv).

Ib yam li ntawd, koj tuaj yeem nug, Kuv yuav ua li cas thiaj li tau txais tus yuam sij txawv teb chaws hauv SQL Developer?

Qhia cov yuam sij txawv teb chaws hauv Oracle SQL Developer

  1. Txhais qhov txuas ntxiv. Muab cov hauv qab no tso rau hauv cov ntaub ntawv XML, piv txwv li. "fk_ref.xml":
  2. Ntxiv qhov txuas ntxiv. Ntxiv rau SQL Developer ntawm cov ntawv qhia zaub mov:
  3. Kuaj nws. Coj mus rau ib lub rooj thiab tam sim no koj yuav tsum pom ib lub tab ntxiv ntawm SQL ib qho, sau tias "FK References", uas qhia cov ntaub ntawv FK tshiab.

Kuj Paub, Kuv yuav ntxiv tus yuam sij txawv teb chaws rau lub rooj li cas? Tsim kev sib raug zoo txawv teb chaws hauv Table Designer

  1. Hauv Object Explorer, right-click lub rooj uas yuav nyob rau sab nraud-qhov tseem ceeb ntawm kev sib raug zoo thiab nyem Tsim.
  2. Los ntawm Table Designer ntawv qhia zaub mov, nyem Relationships.
  3. Nyob rau hauv lub Foreign-key Relationships dialog box, nyem Ntxiv.

Ntxiv mus, qhov twg yog qhov tseem ceeb ntawm kev sib raug zoo hauv Oracle SQL Developer?

Thawj txoj kev yog nrog cov lus Constraints tab (xaiv lub rooj thiab xaiv Constraints tab). Tab sau cov lus txwv - thawj, tshwj xeeb thiab cov yuam sij txawv teb chaws thiab kuaj kev txwv - tag nrho hauv ib daim phiaj. Cov yuam sij txawv teb chaws yog cov uas muaj 'Foreign_Key' tus nqi hauv CONSTRAINT_TYPE kem.

Kuv yuav nrhiav tau tus yuam sij txawv teb chaws hauv lub rooj li cas?

Thaum twg rooj ORDER muaj ib daim teb uas yog thawj- tus yuam sij teb hauv rooj CUSTOMER, uas teb hauv rooj ORDER yog hu ua a txawv teb chaws key . Thaum a rooj muaj ib kem (los yog concatenation ntawm kab) uas yog tib yam li thawj tus yuam sij ntawm a rooj , kab npe hu ua a txawv teb chaws key.

Pom zoo: