Hi Thayalini,
SAP DBTech JDBC: [451]: modification of subject table in trigger not allowed: DEMO.TEST
This error message seems to indicate that you are trying to insert/update/delete back into the table on which you created the trigger. This is not supported or possible.
Could not execute 'CREATE TRIGGER TEST_TR AFTER INSERT ON DIM REFERENCING NEW ROW newRow BEGIN CALL ...' in 95 ms 671 µs .
SAP DBTech JDBC: [7]: feature not supported: call procedure is not supported in trigger
Calling a procedure from a trigger is also not supported. You can find the documentation for this in sql reference guide on page 98 - 99.
In order to achieve your requirement you can try a 2 table approach. For example -
Create table A containing fields aa, bb, cc
Create table B containing fields aa, bb, cc, uuid
Create trigger trigger_name after INSERT on A referencing NEW ROW row_var
FOR EACH ROW
BEGIN
DECLARE uuidvar varchar(20) := ' ';
select sysuuid from dummy into uuidvar;
insert into B values( :row_var.aa, :row_var.bb, :row_var.cc, :uuidvar);
END;
So now when your user inserts aa, bb, cc into table A, the trigger is executed and transfers these values to table B and also inserts the SYSUUID generated by the select from dummy statement.
The disadvantage you have here is you have to maintain two tables with "almost" the same data for this to work. If all you want is a unique identifier then you can try using sequences, but if you want to be able to populate uuid the above solution is one possibility.
If you are inserting via an xsjs script, you can avoid triggers and have a single table. To achieve this within the xsjs script you can have a select on dummy to generate your uuid, then perform the insert of the user values along with the generated uuid at the same time.
Cheers,
Sharan