SQL error: sortconcat() unknown
Hello, I'm trying to extract some data out of the metadata.db SQLite file with SQL queries. Works fine till I try to use the VIEW meta. It is defined with a function that does not exist in the schema or in sqlite3 apparently...
Please tell me if there is another way to get that data w/o SQL.
I'm trying to find which books have been added since N days or since a specific date in order to publish it some way (I can output json/xml/plain text).
Thanks.
SQL query:
---
select id, title, authors, series from meta
where id in (select books.id as bid, custom_column_1.value as v
from books, custom_column_1
where v >= ? and bid = custom_column_1.book
order by v)
order by authors;
---
it always fails with:
no such function: sortconcat: select id, title, authors, series from meta where id in (select books.id as bid, custom_column_1.value as v
from books, custom_column_1
where v >= ? and bid = custom_column_1.book
order by v) order by authors;
indeed in the meta VIEW description there is sortconcat():
---
CREATE VIEW meta AS
SELECT id, title,
(SELECT sortconcat(bal.id, name) FROM books_authors_link AS bal JOIN authors ON(author = authors.id) WHERE book = books.id) authors,
(SELECT name FROM publishers WHERE publishers.id IN (SELECT publisher from books_publishers_link WHERE book=books.id)) publisher,
(SELECT rating FROM ratings WHERE ratings.id IN (SELECT rating from books_ratings_link WHERE book=books.id)) rating,
timestamp,
(SELECT MAX(uncompressed_size) FROM data WHERE book=books.id) size,
(SELECT concat(name) FROM tags WHERE tags.id IN (SELECT tag from books_tags_link WHERE book=books.id)) tags,
(SELECT text FROM comments WHERE book=books.id) comments,
(SELECT name FROM series WHERE series.id IN (SELECT series FROM books_series_link WHERE book=books.id)) series,
series_index,
sort,
author_sort,
(SELECT concat(format) FROM data WHERE data.book=books.id) formats,
isbn,
path,
lccn,
pubdate,
flags,
uuid
FROM books;
---
|