Yog vim li cas bulk sau yog sai dua nyob rau hauv Oracle?
Yog vim li cas bulk sau yog sai dua nyob rau hauv Oracle?

Video: Yog vim li cas bulk sau yog sai dua nyob rau hauv Oracle?

Video: Yog vim li cas bulk sau yog sai dua nyob rau hauv Oracle?
Video: Npau Suav li no Txhob coj mus tham qhia luag lwm tus 2024, Hlis ntuj nqeg
Anonim

Txij li thaum BULK sau nqa cov ntaub ntawv hauv BULK , INTO clause yuav tsum muaj ib qho kev sau hom sib txawv. Lub ntsiab kom zoo dua ntawm kev siv BULK sau yog nws nce lub kev ua tau zoo los ntawm kev txo cov kev sib cuam tshuam ntawm database thiab PL/SQL cav.

Ib yam li ntawd, koj tuaj yeem nug, thaum twg kuv yuav tsum siv cov khoom ntim ntau?

Thaum koj paub tseeb tias qhov rov qab los ntawm koj daim ntawv SELECT yog me me ces koj yuav tsum siv Bulk Collect clause nrog Select-Into nqe lus. Txwv tsis pub koj bulk sau clause yuav ua rau koj cov lus Select-Into ib lub cim xeeb hogging dab. Yog li ntawd nws yuav slowdown qhov kev ua tau zoo ntawm koj database.

Tsis tas li ntawd, ntau npaum li cas sau ua haujlwm hauv Oracle? A bulk collect yog ib txoj hauv kev nqa cov ntaub ntawv qhov twg PL / SQL cav qhia SQL cav rau sau ntau kab ib zaug thiab muab tso rau hauv ib sau . Lub cav SQL khaws tag nrho cov kab thiab thauj lawv mus rau hauv sau thiab hloov rov qab mus rau PL/SQL cav. Tag nrho cov kab yog retrieved nrog tsuas yog 2 lub ntsiab lus hloov pauv.

Hauv qhov no, qhov sib txawv ntawm kev sau ntau thiab ntau khi hauv Oracle yog dab tsi?

Tej pob khoom : yog CLAUSE. yog siv los nqa cov ntaub ntawv los ntawm tus cursor. Forall : yog ib nqe lus. yog siv los ua dml kev ua haujlwm ntawm cov ntaub ntawv khaws tseg. Lub cev ntawm lub FORALL nqe lus yog ib nqe lus DML - ib qho INSERT, Hloov Kho, lossis DELETE. INTO, FETCH INTO, thiab rov qab mus rau hauv cov nqe lus.

bulk collect yog dab tsi thiab muaj kev txwv nyob rau hauv bulk collect?

Siv lub BULK COLLECT clause hauv PL/SQL implies raws li nram no txwv : Cov ntawv sau yuav tsum tau siv los ua cov hom phiaj sib txawv uas tau teev tseg hauv a BULK sau INTO clause. 4. Cov hom phiaj sib xyaw (xws li cov khoom siv) tsis tuaj yeem siv rau hauv tus RETURNING INTO clause lwm qhov yuam kev yog qhia rau feature nrog RETURNING clause.

Pom zoo: