Skip to content
Advertisement

Oracle Compound Trigger : PLS-00103 Encountered when Attempting to get Max of Date Column

I am trying to construct a trigger that will update Table B with Max value end_date column when the corresponding end_date of table A is updated.

This is so I can calculated and save the date difference between a date that I have saved prior to this, and the max end date that I want constantly updated from Table A.

So far compound trigger seems like a valid solution given that my row trigger does not fully cover all the use cases, however, I got the error stated in the title.

Full error:

PLS-00103: Encountered the symbol “)” when expecting one of the following: current delete exists prior

I have tried to find out any syntax error that I might have overlooked, but so far I can’t manage to progress.

The database version seemed to be correct as well, as I am using oracle 11g which should support compound triggers.

This is the aforementioned SQL:

I commented on the line of code that the tool I am using tells me the error is at, if it helps at all.

Do forgive me if this problem is suppose to be easy to solve; I am still not that familiar with PL/SQL and would love to learn more.

Advertisement

Answer

Please remove the comma after TABLE_B.MAX_DATE%TYPE

Also,

FOR UPDATE OR INSERT OF END_ON ON TABLE_A should be FOR UPDATE OF END_ON OR INSERT ON

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement