 ERROR: The string v_agamosp. is not a valid ColdFusion variable name.
 ERROR: The string v_canonical string is not a valid ColdFusion variable name.
 ERROR: The string v_subf. is not a valid ColdFusion variable name.
-ERROR: The string v_canonical_ name is not a valid ColdFusion variable name.
+
+
+
+select scientific_name from temp_dnametest where gdisplay_name = 'ERROR: The string v_canonical name is not a valid ColdFusion variable name.';
 
 update temp_dnametest set gdisplay_name=null where gdisplay_name ='ERROR: The request has exceeded the allowable time limit Tag: CFLOOP';
 update temp_dnametest set gdisplay_name=null where gdisplay_name ='ERROR: The request has exceeded the allowable time limit Tag: CFQUERY';



select taxon_name_id,count(*) from temp_dnametest having count(*) > 1 group by taxon_name_id;


create index ix_temp_junk on temp_dnametest (taxon_name_id) tablespace uam_idx_1;

update temp_dnametest set gdisplay_name=null where gdisplay_name ='xxxxxx';
update temp_dnametest set gdisplay_name=null where gdisplay_name ='xxxxxx';

update temp_dnametest set gdisplay_name=null where gdisplay_name ='ERROR: The string v_scientific name is not a valid ColdFusion variable name.';

select scientific_name from temp_dnametest where gdisplay_name='ERROR: The string v_canonical_ name is not a valid ColdFusion variable name.';
update temp_dnametest set gdisplay_name=null where gdisplay_name ='ERROR: The string v_canonical_ name is not a valid ColdFusion variable name.';

-- I hate you so much, ITIS....

declare
	hasKingdom number;
begin
	for r in (select * from temp_dnametest where gdisplay_name='ERROR: The string v_subsp. is not a valid ColdFusion variable name.') loop
		select count(*) into hasKingdom from taxon_term where taxon_name_id=r.taxon_name_id and
			source='Arctos' and term_type='kingdom' and term='Animalia';
		if hasKingdom=1 then
			dbms_output.put_line('yup');
			dbms_output.put_line(r.scientific_name);
			update taxon_term set term_type='subspecies',term=replace(term,' subsp.') where
				  taxon_name_id=r.taxon_name_id and
				source='Arctos' and term_type='subsp.'
				;
		end if;
	end loop;
end;
/
-- next...
-- Arthropoda (phylum)

declare
	c number;
begin
	for r in (select * from temp_dnametest where gdisplay_name='ERROR: The string v_subsp. is not a valid ColdFusion variable name.') loop
		select count(*) into c from taxon_term where taxon_name_id=r.taxon_name_id and
			source='Arctos' and term_type='phylum' and term='Arthropoda';
		if c=1 then
			dbms_output.put_line('yup: ' || r.scientific_name);
			update taxon_term set term_type='subspecies',term=replace(term,' subsp.') where
				  taxon_name_id=r.taxon_name_id and
				source='Arctos' and term_type='subsp.'
				;

		else
			dbms_output.put_line('nope: ' || r.scientific_name);

		end if;
	end loop;
end;
/
declare
	c number;
begin
	for r in (select * from temp_dnametest where gdisplay_name='ERROR: The string v_subsp. is not a valid ColdFusion variable name.') loop
		select count(*) into c from taxon_term where taxon_name_id=r.taxon_name_id and
			source='Arctos' and term_type='nomenclatural_code' and term='ICZN';
		if c=1 then
			dbms_output.put_line('yup: ' || r.scientific_name);
			update taxon_term set term_type='subspecies',term=replace(term,' subsp.') where
				  taxon_name_id=r.taxon_name_id and
				source='Arctos' and term_type='subsp.'
				;


		else
			dbms_output.put_line('nope: ' || r.scientific_name);

		end if;
	end loop;
end;
/

declare
	c number;
begin
	for r in (select * from temp_dnametest where gdisplay_name='ERROR: The string v_subsp. is not a valid ColdFusion variable name.') loop
		select count(*) into c from taxon_term where taxon_name_id=r.taxon_name_id and
			source='Arctos' and term_type='nomenclatural_code' and term='ICNB';
		if c=1 then
			dbms_output.put_line('yup: ' || r.scientific_name);



		else
			dbms_output.put_line('nope: ' || r.scientific_name);

		end if;
	end loop;
end;
/



