SAP Knowledge Base Article - Preview

2651776 - Delete Trigger behavior when using an IN clause - SAP ASE

Symptom

Delete trigger has a different behavior when using an IN clause:

1) We can see the exclusion date (date_exc) is NULL:

select code_item, date_exc
from log_table
go
code_item date_exc
----------- ---------------
210012745 NULL
237700379 NULL
219958568 NULL
946000348 NULL
207104452 NULL
273539295 NULL

2) Then we delete two rows in separate command:

delete base_table
where code_item = '210012745'
go
delete base_table
where code_item = '237700379'
go
(1 row affected)
(1 row affected)

3) We will see that exclusion date (date_exc) is updated for both rows:

select code_item, date_exc
from log_table
where code_item in ('210012745','237700379')
go
code_item date_exc
----------- ---------------
210012745 May 29 2018 11:39AM
237700379 May 29 2018 11:39AM

4) If we delete the rows using IN:

delete base_table
where code_item in ('219958568','946000348')
go
(2 rows affected)

5) We will see that exclusion date (date_exc) is updated for only one row:

select code_item, date_exc
from log_table
where code_item in ('219958568','946000348')
go
code_item date_exc
----------- ---------------
219958568 NULL
946000348 May 29 2018 11:40AM


Read more...

Environment

  • SAP Adaptive Server Enterprise 12.5
  • SAP Adaptive Server Enterprise 15.7
  • SAP Adaptive Server Enterprise 16.0

Product

SAP Adaptive Server Enterprise 15.7

Keywords

trigger delete behavior IN incorrect results , 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 ONE Support launchpad (Login required).

Search for additional results

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