SAP Knowledge Base Article - Preview

3154227 - Trigger not working as expected. - SAP ASE

Symptom

  • Trigger set to delete records, is not working as expected. 
  • When used with a set rowcount 1 -- it works as expected and fires the trigger - to rollback
  • When set rowcount 0 -- it does not work as expected - it does not fire the trigger and data is deleted.

    create trigger mytable_delete 
    on mytable 
    for delete as
    set rowcount 0 
    if  (select count(*)
        from deleted, mytable 
        where mytable.LoginName = deleted.LoginName and deleted.LoginName in ('login1','login3','login2')) > 0
      begin 
        rollback transaction 
        print "You are not allowed to delete login1 , login3 or login2 entries from mytable , Contact Engineering Team"
      end
    go


Read more...

Environment

SAP Adaptive Server Enterprise (ASE) 16.0

Product

SAP Adaptive Server Enterprise 16.0

Keywords

KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.