Batch processing (location)

Started by RobertG, 18 August 2026, 16:33:25

Previous topic - Next topic

RobertG

Hi,

I'm trying to reorganise my personal library by grouping books by author, and I'd like to specify their location on the shelves in Abook.

Apart from running complex SQL queries directly on the database to populate the idlocation field in the #__abbook table, is there a simpler solution? For example, I have 18 books by a particular author on the 'Office B2' shelf (ID 3), and I'd prefer not to have to edit all 18 books (my library currently contains 468).

Thank you for your advice.

RobertG

Hi,

I found how to select books, but how to update the idlocation field in the sql?
QuoteSELECT a.id, a.idlocation, b.idauth, b.idbook FROM t0dq9_abbook as a INNER JOIN t0dq9_abbookauth as b ON a.id = b.idbook WHERE b.idauth = 113 ORDER BY b.idbook asc;

federica

You can make an update query of the all book of author with id 113 (replace NEW_VALUE to real id of location)

UPDATE t0dq9_abbook AS a
INNER JOIN t0dq9_abbookauth AS b ON a.id = b.idbook
SET a.idlocation = NEW_VALUE
WHERE b.idauth = 113;

Remember to backup your database before running the query
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]