gpt4 book ai didi

sql - ora-01086 : save point was not established or invalid

转载 作者:行者123 更新时间:2023-12-04 18:08:22 29 4
gpt4 key购买 nike

Ora-01086 : 保存点未建立或无效。
KRD_UPD_BORCTAHSILATYAP_SP 此 SP 引发错误。
当我在下面测试此循环时,出现错误:ora-01086

通常它在不调用外部 sp 的情况下工作,我使用内联错误对其进行测试,然后回滚到保存点。我错过了什么?

FOR rec IN (...records.....
)
LOOP
SAVEPOINT odemeIslemiBaslangic;
BEGIN


CASE rec.prosedur_ad
WHEN 'KRD' THEN

KRD_UPD_BORCTAHSILATYAP_SP(rec.musterino, rec.urundegeri, rec.taksitno, v_MuhasebeReferans, v_IslemReferans, v_Tarih);
IF v_MuhasebeReferans IS NOT NULL THEN
v_SonucKd := 10;
v_Aciklama := 'Başarılı işlem';
ELSE
v_SonucKd := 9;
v_Aciklama := 'Borç bulunamadı';
END IF;

END CASE;
cll_ins_tahsilatislem_sp(p_odemeno => rec.odemeno,
p_islemtarihi => v_Tarih,
p_musterino => rec.musterino,
p_urundeger => rec.urundegeri,
p_islemref => v_IslemReferans,
p_muhasebesubekd => rec.sube_kd,
p_muhaseberef => v_MuhasebeReferans,
p_aciklama => v_Aciklama,
p_sonuc => v_SonucKd,
p_kayityapan => v_KayitYapan,
p_kayittrxkod => v_KayitTrxKod);
UPDATE cll_gecikmisbankaalacak u
SET u.sonuc_kd = v_SonucKd
WHERE u.odemeno = rec.odemeno
AND u.kayit_drm = 'A';
EXCEPTION
WHEN OTHERS THEN
ROLLBACK TO SAVEPOINT odemeIslemiBaslangic;
v_SonucKd := 1;
v_Aciklama := 'İşlem Hata: ' || substr(SQLERRM, 1, 400);
cll_ins_tahsilatislem_sp(p_odemeno => rec.odemeno,
p_islemtarihi => v_Tarih,
p_musterino => rec.musterino,
p_urundeger => rec.urundegeri,
p_islemref => v_IslemReferans,
p_muhasebesubekd => rec.sube_kd,
p_muhaseberef => v_MuhasebeReferans,
p_aciklama => v_Aciklama,
p_sonuc => v_SonucKd,
p_kayityapan => v_KayitYapan,
p_kayittrxkod => v_KayitTrxKod);
UPDATE cll_gecikmisbankaalacak u
SET u.sonuc_kd = v_SonucKd
WHERE u.odemeno = rec.odemeno
AND u.kayit_drm = 'A';
END;

END LOOP;

最佳答案

您的评论表明您正在调用的程序,KRD_UPD_BORCTAHSILATYAP_SP , 正在回滚整个交易,即发出一个简单的 ROLLBACK .

来自 documentation for ROLLBACK :

Using ROLLBACK without the TO SAVEPOINT clause performs the following operations:

  • Ends the transaction
  • Undoes all changes in the current transaction
  • Erases all savepoints in the transaction
  • Releases any transaction locks


因此,您在调用块中建立的保存点将被删除,因此您无法再回滚到该保存点。

关于sql - ora-01086 : save point was not established or invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21138597/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com