[Evergreen-dev] Pulling audit_user for a change from auditor table

Josh Stompro stomproj at gsuite.larl.org
Tue Sep 21 00:06:13 EDT 2021


Hello, I'm stuck on how to grab the user that made a change from an auditor
table?  How do I look for the first occurrence of a new value, and then
grab the previous rows audit_user and audit_date?

The way that I understand it, the auditor tables store the user that made a
change, and then the old values that were in the audited table before the
change.  So the audit_user and audit_date are not for the data in the same
row, but are for the next newest row.

Do I need a window function so I can look at previous rows?  Or is there a
much simpler way to do it?  Maybe a window with lag()/lead() to shift the
audit_user and audit_date to the next row?

I'm working on seeing if I can pull out barcode creation info, to fill in
actor.card creator and create_date for LP#1705332, which adds those fields
into actor.card.

Thanks for any hints.
Josh
[image: Company logo]
*Josh Stompro*

*IT Director stomproj at gsuite.larl.org <stomproj at gsuite.larl.org>*
*218-233-3757 ext. 139* | *Mobile: 218-790-2110*

*Lake Agassiz Regional Library | **www.larl.org <http://www.larl.org>*
118 5th ST S
Moorhead MN 56560
*Celebrating 60 Years of Service in 2021!*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-dev/attachments/20210920/8b522276/attachment.html>


More information about the Evergreen-dev mailing list