Database Function Description of "number_of_manufacturer_ref"

Name

number_of_manufacturer_ref

Description

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.

Purpose

To retrieve the number of references to a particular manufacturer.

Schema

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';

Related tables

History

Used first

Version 2.5

Used last

Still in use

Change history

= 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';
podoc/number_of_manufacturer_ref_sql_function.txt · Last modified: 2007/10/19 12:07 by Luud
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0