Emiliano Heyns
unread,Aug 2, 2026, 8:35:19 PM (2 days ago) Aug 2Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to zotero-dev
Are WITH queries not supported in Zotero? In this case:
var q = "WITH CitationKeys AS (SELECT id.itemID, idv.value AS citationKey FROM itemData id JOIN fields f ON id.fieldID = f.fieldID JOIN itemDataValues idv ON id.valueID = idv.valueID WHERE f.fieldName = 'citationKey') SELECT * FROM CitationKeys";
//var q = "SELECT id.itemID, idv.value AS citationKey FROM itemData id JOIN fields f ON id.fieldID = f.fieldID JOIN itemDataValues idv ON id.valueID = idv.valueID WHERE f.fieldName = 'citationKey'";
const rows = await Zotero.DB.queryAsync(q, [], { noParseParams: true })
return rows.length
I would have expected both queries to return the same result, but the first returns `undefined` into rows, while the 2nd gives me the results I expect.