801: -- fdi usages for that. Used when updating a route.
802: CURSOR c_formula_id ( p_route_id number) is
803: select /*+ ORDERED
804: INDEX(C FF_USER_ENTITIES_FK1)
805: INDEX(B FF_DATABASE_ITEMS_FK1)
806: INDEX(A FF_FDI_USAGES_F_N50) */
807: distinct a.formula_id
808: from ff_user_entities c,
809: ff_database_items b,
805: INDEX(B FF_DATABASE_ITEMS_FK1)
806: INDEX(A FF_FDI_USAGES_F_N50) */
807: distinct a.formula_id
808: from ff_user_entities c,
809: ff_database_items b,
810: ff_fdi_usages_f a
811: where a.item_name = b.user_name
812: and a.usage = 'D'
813: and b.user_entity_id = c.user_entity_id
820: -- seed database items. However user formulas can see core and owning legislation
821: -- code dbitems.
822: select distinct fdi.formula_id from
823: ff_fdi_usages_f fdi
824: ,ff_database_items dbi
825: ,ff_user_entities ue
826: ,ff_formulas_f f
827: where fdi.ITEM_NAME = p_user_name
828: and fdi.USAGE = 'D'