Skip to Content
-1

Create TRIGGER with TABLE STATEMENT on HANA

May 07 at 12:52 PM

42

avatar image

Hi,

I am not able to create a TRIGGER on a column table as soon as I try using a table. This workds fine for the same TRIGGER using rows. But I can not use rows as we have much too many records.

Here is what works fine:

-- Insert TRIGGER ROW
CREATE TRIGGER INSERT_TRIGGER_ROW
AFTER INSERT ON "test.track_delete::create_table.CCR_FINALMARKETID_01"
REFERENCING NEW ROW mynewrow
FOR EACH ROW
BEGIN
INSERT into "S00049863"."test.track_delete::create_table.CCR_FINALMARKETID_01_TRIGGER"
VALUES(:mynewrow."GUID", :mynewrow."CURVE", :mynewrow."DATE",
'', 'I',
CURRENT_DATE, CURRENT_TIME,
CURRENT_TIMESTAMP)
;
END;

Here is what does not work:

-- Insert TRIGGER TABLE
CREATE TRIGGER INSERT_TRIGGER_TABLE
AFTER INSERT ON "test.track_delete::create_table.CCR_FINALMARKETID_01"
REFERENCING NEW TABLE AS newtable
FOR EACH STATEMENT
BEGIN
INSERT into "S00049863"."test.track_delete::create_table.CCR_FINALMARKETID_01_TRIGGER"
SELECT "GUID", "CURVE", "DATE",
'', 'I',
CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP
FROM :newtable;
END;

The error message is not about the SQL statement but about the column table:

Could not execute 'CREATE TRIGGER INSERT_TRIGGER_TABLE AFTER INSERT ON ...'
SAP DBTech JDBC: [7]: feature not supported: Cannot create statement trigger on column table: test.track_delete::create_table.CCR_FINALMARKETID_01: line 2 col 18 (at pos 54)

Some help would be very welcome.

Regards,

Laurent

10 |10000 characters needed characters left characters exceeded
0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sergio Guerrero May 07 at 04:13 PM
1

the url

https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/1.0.12/en-US/20d5a65575191014946db96aaedbef5b.html

says triggers are only valid on row tables - this is probably why your statement isnt working due to your column table

Share
10 |10000 characters needed characters left characters exceeded