number_of_manufacturer_ref
Counts the number of references to a particular manufacturer.
Tentative (is this correct?): this represents the number of equipment items in the database created by the specified manufacturer.
To retrieve the number of references to a particular manufacturer.
CREATE FUNCTION number_of_manufacturer_ref(INTEGER) RETURNS BIGINT AS ' select ((select count(identifier) from lens_type where manufacturer = $1) + (select count(identifier) from camera_type where manufacturer = $1) + (select count(identifier) from scanner_type where manufacturer = $1) + (select count(identifier) from support_type where manufacturer = $1) + (select count(identifier) from film_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1)) ' LANGUAGE 'sql';
Version 2.5
Still in use
= Version 2.5 =
CREATE FUNCTION number_of_manufacturer_ref(INTEGER) RETURNS BIGINT AS 'select ((select count(identifier) from lens_type where manufacturer = $1) + (select count(identifier) from camera_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1) + (select count(identifier) from scanner_type where manufacturer = $1) + (select count(identifier) from support_type where manufacturer = $1) + (select count(identifier) from film_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1))' LANGUAGE 'sql';
= Version 2.34 =
---- Fix up a couple of bogus functions CREATE OR REPLACE FUNCTION number_of_manufacturer_ref(INTEGER) RETURNS BIGINT AS ' select ((select count(identifier) from lens_type where manufacturer = $1) + (select count(identifier) from camera_type where manufacturer = $1) + (select count(identifier) from scanner_type where manufacturer = $1) + (select count(identifier) from support_type where manufacturer = $1) + (select count(identifier) from film_type where manufacturer = $1) + (select count(identifier) from flash_type where manufacturer = $1)) ' LANGUAGE 'sql';