Puas yog Raise_application_error rollback?
Puas yog Raise_application_error rollback?

Video: Puas yog Raise_application_error rollback?

Video: Puas yog Raise_application_error rollback?
Video: "Puag Yoj Mas" [OFFICIAL MUSIC VIDEO] - KT Killing Em 2024, Kaum ib hlis
Anonim

Nyob rau hauv ib tug trigger a RAISE_APPLICATION_ERROR ua tsis ua ib ROLLBACK , nws rho tawm haujlwm tam sim no, piv txwv li ib zaug UPDATE/INSERT/DELETE. A Rov qab thim rov qab txhua qhov kev hloov pauv hauv kev hloov pauv tam sim no (lossis mus txog qhov muab Savepoint), uas txawv.

Ua li no, Raise_application_error yog dab tsi?

Teb: Cov nce_application_error yog qhov ua tau raws li txheej txheem teev tseg los ntawm Oracle uas tso cai rau tus tsim tawm los tsa qhov kev zam thiab koom nrog tus lej yuam kev thiab cov lus nrog cov txheej txheem. Oracle muab cov nce_application_error txheej txheem tso cai rau koj los tsa tus lej yuam kev hauv koj daim ntawv thov.

Tsis tas li ntawd, yuav ua li cas tshwm sim thaum daim ntawv rollback tau ua tiav hauv qhov ua rau? Thaum lub ua rau hluav taws kub tam sim no kev lag luam tseem tsis tiav. Raws li COMMIT txiav tawm kev lag luam tso cai rau lawv nyob rau hauv triggers yuav rhuav tshem cov haujlwm. Yog li hloov raug tua nyob rau hauv ib tug trigger tau cog lus (los yog dov rov qab) los ntawm tus tswv lag luam uas tau muab DML uas raug rho tawm haujlwm ua rau.

Yog li ntawd, qhov txawv ntawm Pragma Exception_init thiab Raise_application_error yog dab tsi?

pragma exception init hloov qhov yuam kev Oracle rau hauv lub npe tshwj xeeb. Yog tias kev ua haujlwm database nce ib qho ORA-00054 "peev txheej tsis khoom", koj yuav tsum tau code:. Raise_application_error yog siv los RAISE qhov yuam kev - kev zam_init yog siv los daws qhov yuam kev (Kuv twv koj tuaj yeem hais tias lawv yog qhov sib txawv hauv a txoj kev).

Sqlerrm yog dab tsi?

SQLERRM Muaj nuj nqi. Txoj haujlwm SQLERRM rov qab cov lus yuam kev cuam tshuam nrog nws qhov yuam kev-ntaus sib cav. Yog tias qhov kev sib cav raug tshem tawm, nws rov qab cov lus yuam kev cuam tshuam nrog tus nqi tam sim no ntawm SQLCODE. SQLERRM nrog tsis muaj kev sib cav yog pab tau tsuas yog nyob rau hauv ib tug tshwj xeeb handler.

Pom zoo: