Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Modification of subject table in trigger not allowed--

$
0
0

Hi All,

 

While executing after trigger in my create trigger code, I am getting error as " modification of subject table in trigger not allowed" . Please find the sample code below:

 

CREATE TRIGGER "DEMO"."TRIG_DEMO1_INSERT"
AFTER INSERT
on "DEMO"."DEMO2"
referencing NEW row INSERTED
FOR EACH ROW

BEGIN
DECLARE ABC nvarchar(4);
DECLARE CDate int;
DECLARE CTime nvarchar(10);

CDate := CAST(TO_VARCHAR(CURRENT_DATE,'YYYYMMDD')AS INT);

CTime := TO_NVARCHAR(CURRENT_TIME,'HH:MI:SS');

ABC:=:INSERTED.ABC;

UPDATE DEMO2 SET XYZ = :CDate, IOP = :CurrentTime where ABC = :ABC;
END;

 

Can anyone tell me how can I achieve this functionality in SAP HANA?

 

Thanks,

Rahul Anand


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>