User Tools

Site Tools


podoc:count_photos_sql_function

Database Function Description of "count_photos"

Name

count_photos

Description

Count the total number of photos.

There are two versions, one that counts all photos and one that counts only those photos up to a given access rights setting.

Purpose

To retrieve the total number of photos.

Schema

CREATE FUNCTION count_photos() RETURNS BIGINT
AS 'select count(identifier) from photo' LANGUAGE 'sql';
CREATE FUNCTION count_photos(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where access_rights <= $1' LANGUAGE 'sql';

History

Used first

Version 2.5

Used last

Still in use

Change history

= Version 2.5 =

CREATE FUNCTION count_photos() RETURNS BIGINT
AS 'select count(identifier) from photo' LANGUAGE 'sql';
CREATE FUNCTION count_photos(INTEGER) RETURNS BIGINT
AS 'select count(identifier) from photo where access_rights <= $1' LANGUAGE 'sql';
podoc/count_photos_sql_function.txt · Last modified: 2007/04/23 14:26 by Luud