podoc:count_subalbums_by_album_sql_function
This is an old revision of the document!
Database Function Description of "count_subalbums_by_album"
Name
count_subalbums_by_album
Description
Count the number of sub-albums in a particular album.
There are two versions, one that counts all albums and one that counts only those albums up to a given access rights setting.
Purpose
To retrieve the number of sub-albums in a particular album.
Schema
CREATE FUNCTION count_subalbums_by_album(INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where parent_album = $1' LANGUAGE 'sql';
CREATE FUNCTION count_subalbums_by_album(INTEGER, INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where parent_album = $1 and access_rights <= $2' LANGUAGE 'sql';
Related tables
History
Used first
Version 2.29
Used last
Still in use
Change history
= Version 2.29 =
CREATE FUNCTION count_subalbums_by_album(INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where parent_album = $1' LANGUAGE 'sql';
CREATE FUNCTION count_subalbums_by_album(INTEGER, INTEGER) RETURNS BIGINT AS 'select count(identifier) from album where parent_album = $1 and access_rights <= $2' LANGUAGE 'sql';
podoc/count_subalbums_by_album_sql_function.1177338472.txt.gz · Last modified: 2007/04/23 14:27 by Luud