Puas yog DDL commands Autocommit?
Puas yog DDL commands Autocommit?
Anonim

Yog ( DDL ) Data Manipulation Language lusAutocommit ? Tsis yog. Tsuas yog tus DDL (Cov ntaub ntawv txhais lus) nqe lus xws li tsim, hloov, poob, truncate yog autocommit.

Ib sab ntawm no, puas yog DML commands Autocommit?

Raws li lub neej ntawd, a DML nqe lus ua tiav yam tsis tau pib qhov kev hloov pauv tau txiav txim siab ua tiav lossis rov qab ua tsis tiav thaum kawg ntawm nqe lus. Tus cwj pwm no hu ua autocommit . Tus cwj pwm no yog tswj nrog lub AUTOCOMMIT parameter. DDL nqe lus ib txwm autocommitted.

Tom qab ntawd, lo lus nug yog, Autocommit hauv SQL yog dab tsi? Hauv cov ntsiab lus ntawm kev tswj cov ntaub ntawv, autocommit isa hom kev ua haujlwm ntawm kev sib txuas database. Lwm txoj rau autocommit hom (tsis yog- autocommit ) txhais tau tias SQL ntawv daim ntawv thov tus neeg siv nws tus kheej yog lub luag haujlwm rau kev tshaj tawm kev pib ua lag luam (pib kev lag luam) thiab txiav tawm (commitor rollback) cov lus txib.

Tom qab ntawd, DDL puas xav tau kev cog lus?

TRUNCATE yog ib DDL hais kom nws tsis xav tau anexplicit cog lus vim hu nws ua ib tug implicit cog lus . Los ntawm kev tsim qauv kev pom kev lag luam yog kev ua lag luam ntawm kev ua haujlwm. Tej zaum nws yuav muaj xws li ib qho DML cov lus qhia ob peb ntawm lawv. Nws tsis muaj teeb meem: tsuas yog kev hloov pauv tag nrho xav tau COMMIT.

Yuav ua li cas thaum Autocommit teem rau?

Yog AUTOCOMMIT tau teeb tsa rau 1, txhua nqe lus SQL tau txiav txim siab ua tiav kev ua lag luam thiab ua tiav los ntawm lub neej ntawd thaum nws ua tiav. Yog AUTOCOMMIT tau teeb tsa mus rau 0, cov nqe lus txuas ntxiv tom ntej ua zoo li kev sib pauv thiab tsis muaj kev sib pauv hloov mus txog thaum cov lus tshaj tawm COMMIT qhia meej.

Pom zoo: