Thursday, July 16, 2020

ora-02055 ora-02069 ora-06512 ora-04088 select Sequence Remote table

Error in executing Trigger 


/* problem */
can not use Sq_Rakshakfreshpledge.nextval direct in remote table

Insert into tblRkfreshpledge@lnk_Rakshak (dTransactiondate,nTransactionno,nSegmenttype,cClientcode,cIsincode,nT2Tscrip,nHaircut,nPledgestock,nMarketvalue,dEntrytime,
        cTransmitted,dTransmittime) Values (:Old.Dtoftran,Sq_Rakshakfreshpledge.nextval,lnCommodity,lcTerminalcode,lcIsincode,lnT2Tscrip,lnHaircut,
        (:new.nUsablepledgestock-:Old.nUsablepledgestock),(:new.nUsablepledgestock-:Old.nUsablepledgestock)*lnMarketrate*lnHaircut,Sysdate,'N',null) ;

Solution

Select Ldbo.Sq_Rakshakfreshpledge.nextval into lnTransactionno From dual ;

        Insert into tblRkfreshpledge@lnk_Rakshak (dTransactiondate,nTransactionno,nSegmenttype,cClientcode,cIsincode,nT2Tscrip,nHaircut,nPledgestock,nMarketvalue,dEntrytime,
        cTransmitted,dTransmittime) Values (:Old.Dtoftran,lnTransactionno,lnCommodity,lcTerminalcode,lcIsincode,lnT2Tscrip,lnHaircut,
        (:new.nUsablepledgestock-:Old.nUsablepledgestock),(:new.nUsablepledgestock-:Old.nUsablepledgestock)*lnMarketrate*lnHaircut,Sysdate,'N',null) ;


No comments:

Post a Comment

Followers