Family and Order are not stored specifically in Recorder, but have to be derived from the Taxonomic hierarchy which is represented in table Taxon_List_Item key. Each entry has a parent, so if you know the start point you can get the parents and the hierarchy. To make this a bit easier table Index_Taxon_Group identifies all the children for each TLI key so that the relationships are easier to get to. Even so getting to family etc. isn't that easy to do and is complicated by the fact that not all Taxon Lists (even the recommended ones) have a complete hierearchy. The following extract from the 'XML reports help' system illustrates some techniques for getting to the information. The next upgrade to Recorder (v6.18) will include a new table (Organism) and some user defined functions which will make it much easier to get to various levels in the hierarchy.
Reporting on Family etc.
Obtaining the family or other level from the taxonomic hierarchy is possible within the limitations of the Dictionaries used for the data. Some Dictionaries do not have any taxanomic hierarchy. The following illustrates SQL which will extract the Family if there is one and if not return the highest taxonomic level available. The Taxon_rank key can be changed to get whatever rank is required. You would need to link the temporary table #Fam to Taxon_Determination and the other table needed to extract the data you require.
CREATE TABLE #Taxa (TLI_Key char(16) COLLATE SQL_Latin1_General_CP1_CI_AS, RecTLI_Key char(16) COLLATE SQL_Latin1_General_CP1_CI_AS)INSERT INTO #Taxa (TLI_KEY,RecTLI_Key)
SELECT DISTINCT TLI.Taxon_List_Item_Key,
ITN.Recommended_Taxon_List_Item_Key
FROM Taxon_List_Item TLI
INNER JOIN Index_Taxon_Name ITN ON TLI.Taxon_List_Item_Key = ITN.Taxon_List_Item_Key
INNER JOIN Taxon_Determination TDET ON TDET.Taxon_List_Item_Key=TLI.TAXON_LIST_ITEM_KEY
WHERE
ITN.Actual_Name like('%')
CREATE TABLE #Fam (REcTLi_Key char(16) COLLATE SQL_Latin1_General_CP1_CI_AS,Fam_Key char(16) COLLATE SQL_Latin1_General_CP1_CI_AS)
Insert INTO #Fam (RecTli_key)
SELECT DISTINCT RECTLi_Key
FROM #Taxa
INNER JOIN Taxon_determination TDET
ON TDET.Taxon_List_Item_key = #Taxa.TLi_key
UPDATE #Fam set Fam_Key = ITG.Taxon_List_Item_Key
FROM Index_taxon_Group ITG
INNER JOIN #Fam ON #Fam.RecTli_key = ITG.Contained_List_Item_key
INNER JOIN Taxon_List_Item TLi
ON TLI.Taxon_list_item_key = ITG.Taxon_List_Item_Key AND TLI.Taxon_Rank_Key = 'NBNSYS0000000018'
UPDATE #Fam set Fam_Key = ITG.Taxon_List_Item_Key
FROM Index_taxon_Group ITG
INNER JOIN #Fam ON #Fam.RecTli_key = ITG.Contained_List_Item_key
INNER JOIN Taxon_List_Item TLi
ON TLI.Taxon_list_item_key = ITG.Taxon_List_Item_Key AND ITG.Item_level =
(Select max(item_level) FROM Index_taxon_Group ITG3
WHERE ITG3.Contained_list_item_Key =#Fam.Rectli_key)
AND #Fam.Fam_key Is null
Select ITn.Actual_Name, ITN2.Actual_Name from #Fam
INNER JOIN Index_Taxon_Name ITN
ON ITN.taxon_List_Item_key = #Fam.rectli_key
left JOin INDEX_Taxon_Name ITN2
ON ITn2.Taxon_List_Item_key = #Fam.fam_Key
ORDER BY ITN.Actual_name
DROP TABLE #Taxa
DROP Table #Fam
Mike Weideli