Revision 6816
Added by Aaron Marcuse-Kubitza over 11 years ago
cvs.~.utils.sql | ||
---|---|---|
35 | 35 |
|
36 | 36 |
-- DROP FUNCTION plantconcept_plantnames(integer); |
37 | 37 |
|
38 |
CREATE OR REPLACE FUNCTION plantconcept_plantnames(IN "PLANTCONCEPT_ID" integer, OUT "Kingdom" text, OUT "Subkingdom" text, OUT "Superdivision" text, OUT "Division" text, OUT "Subdivision" text, OUT "Class" text, OUT "Subclass" text, OUT "Order" text, OUT "Family" text, OUT "Genus" text, OUT "Species" text, OUT "Subspecies" text, OUT "Variety" text, OUT "Forma" text)
|
|
38 |
CREATE OR REPLACE FUNCTION plantconcept_plantnames(IN "PLANTCONCEPT_ID" integer, OUT "Kingdom" text, OUT "Subkingdom" text, OUT "Division" text, OUT "Class" text, OUT "Subclass" text, OUT "Order" text, OUT "composite family" text, OUT "family" text, OUT "tribe" text, OUT "composite genus" text, OUT "genus" text, OUT "subgenus" text, OUT "section" text, OUT "composite species" text, OUT "species" text, OUT "subspecies" text, OUT "composite variety" text, OUT "variety" text)
|
|
39 | 39 |
RETURNS record AS |
40 | 40 |
$BODY$ |
41 | 41 |
WITH "level_plantName" AS ( |
... | ... | |
47 | 47 |
SELECT |
48 | 48 |
(SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Kingdom') |
49 | 49 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Subkingdom') |
50 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Superdivision') |
|
51 | 50 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Division') |
52 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Subdivision') |
|
53 | 51 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Class') |
54 | 52 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Subclass') |
55 | 53 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Order') |
56 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Family') |
|
57 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Genus') |
|
58 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Species') |
|
59 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Subspecies') |
|
60 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Variety') |
|
61 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'Forma') |
|
54 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'composite family') |
|
55 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'family') |
|
56 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'tribe') |
|
57 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'composite genus') |
|
58 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'genus') |
|
59 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'subgenus') |
|
60 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'section') |
|
61 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'composite species') |
|
62 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'species') |
|
63 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'subspecies') |
|
64 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'composite variety') |
|
65 |
, (SELECT "plantName" FROM "level_plantName" WHERE "taxonLevel" = 'variety') |
|
62 | 66 |
$BODY$ |
63 | 67 |
LANGUAGE sql STABLE STRICT |
64 | 68 |
COST 100; |
Also available in: Unified diff
inputs/CVS/cvs.~.utils.sql: plantconcept_plantnames(): Use CVS's taxonLevel values, which are different from the VegBank plantLevel values that the original version of this function used