Connecting Tech Pros Worldwide Help | Site Map

trigger error

Site Addict
 
Join Date: Feb 2007
Posts: 553
#1: Sep 8 '09
Hi

Please help me create a trigger. This is the code but i am getting errors

CREATE Trigger MyTrigger
AFTER
update [or delete] on dbo.Products
REFERENCING OLD AS oldRow
for each row
BEGIN
UPDATE ncache_db_sync
SET modified = 1
WHERE cache_key = (Cast(Select oldRow.ProductID FROM deleted OLD) As VarChar) + ':dbo.Products'
END TRIGGER;


Errors:

4 26 PL/SQL: ORA-00936: missing expression
2 2 PL/SQL: SQL Statement ignored
5 12 PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with


I could not figure out the problem, please help

Thanks
amitpatel66's Avatar
Moderator
 
Join Date: Mar 2007
Location: Hyderabad, India
Posts: 2,192
#2: Sep 8 '09

re: trigger error


Try this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE Trigger MyTrigger
  3. AFTER
  4. update or delete on dbo.Products 
  5. REFERENCING OLD AS oldRow
  6. for each row
  7. BEGIN
  8. UPDATE ncache_db_sync
  9. SET modified = 1
  10. WHERE cache_key = (Cast(Select :oldRow.ProductID FROM deleted) As VarChar) + ':dbo.Products';
  11. END MyTrigger; 
  12.  
  13.  
Reply

Tags
trigger


Similar Oracle Database bytes