 <cfinclude template = "/includes/_header.cfm">
+
+
 <!--- from the effort to create names for all terms
 
 https://github.com/ArctosDB/arctos/issues/891


-- now findLowestTerm

---->


<cfoutput>
	<cfquery name="cols" datasource="uam_god">
		select column_name from user_tab_cols where table_name='TEMP_NEW_CLASS_TEMP' ORDER BY INTERNAL_COLUMN_ID
	</cfquery>

	<cfdump var=#cols#>

	<cfif action is "findLowestTerm">
		<cfquery name="d" datasource="uam_god">
			select * from temp_tax_funk where lowest_term is null
		</cfquery>
	</cfif>


<cfif action is "findOne">



<cfset diff_term="nomenclatural_code">
<cfset src_term="Asilini">


<cfquery name="f" datasource="uam_god">
	select distinct
		scientific_name,

		taxon_name
	where
		taxon_term.taxon_name_id=taxon_name.taxon_name_id and
		upper(term_type)='#ucase(dterm)#' and
		source='Arctos' and
		taxon_term.taxon_name_id in (
			select taxon_name_id from taxon_term where term='#src_term#' and source='Arctos'
		)
	order by term,scientific_name
</cfquery>
<!--- refresh while we're here --->
<cftransaction>
	<cfquery name="flush" datasource="uam_god">
		delete from temp_related_funky_taxonomy where wonky_term='#src_term#' and used_as_rank='#diff_term#'
	</cfquery>
	<cfloop query="f">
		<cfquery name="ins" datasource="uam_god">
			insert into temp_related_funky_taxonomy (
				wonky_term,
				using_name,
				used_as_rank,
				used_value
			) values (
				'#src_term#',
				'#f.scientific_name#',
				'#diff_term#',
				'#f.term#'
			)
		</cfquery>
	</cfloop>
</cftransaction>
<br>cache refreshed
<table border>
	<tr>
		<th>ScientificName</th>
