find customer no-lock. delete customer QUIZ

Posted by cverbiest on 05-Mar-2020 17:46

find last customer no-lock.
delete customer.
disp custnum.

which error do you expect

Answer A :

** No Customer record is available. (91)

Answer B :

** The Customer record has NO-LOCK status. DELETE not allowed. (335)

Answer C :

It depends

See attachment for clue

[View:/cfs-file/__key/communityserver-discussions-components-files/26/delcust.p:32:32]

Posted by Patrick Tingen on 06-Mar-2020 08:37

Haha, I assume you have run into this and pulled your hair out, wondering what was going on?

Posted by cverbiest on 06-Mar-2020 07:47

Answer A if you use the attached delete trigger.

The delete trigger fires , causes a lock on the record and the delete goes ahead.

All Replies

Posted by Stefan Drissen on 05-Mar-2020 21:47

Answer D:

Open orders exist for Customer  8580 .  Cannot delete.

Answer E (in a two second attempt to subvert the sports database):

Attempt to OVERRIDE a schema delete trigger for Customer. (3224)

Posted by ntwatkins on 05-Mar-2020 21:53

The code as you have written above will result in Answer B, assuming at least one customer exists.  If no customer exists, then Answer A.

Posted by cverbiest on 06-Mar-2020 07:47

Answer A if you use the attached delete trigger.

The delete trigger fires , causes a lock on the record and the delete goes ahead.

Posted by Patrick Tingen on 06-Mar-2020 08:37

Haha, I assume you have run into this and pulled your hair out, wondering what was going on?

This thread is closed