select category_id from categories where parent_id = :category_id and deprecated_p = 'f' order by tree_id, left_ind select parent_id from categories where category_id = :category_id select category_id from category_translations where name = :name and locale = :locale select 1 from category_translations where category_id = :category_id and locale = :locale delete from category_object_map where object_id = :object_id insert into category_object_map (category_id, object_id) select :category_id, :object_id where not exists (select 1 from category_object_map where category_id = :category_id and object_id = :object_id); insert into category_object_map (category_id, object_id) (select l.to_category_id as category_id, m.object_id from category_links l, category_object_map m where l.from_category_id = m.category_id and m.object_id = :object_id and not exists (select 1 from category_object_map m2 where m2.object_id = :object_id and m2.category_id = l.to_category_id)) select category_id from category_object_map where object_id = :object_id select co.tree_id, aot.title, c.category_id, ao.title from category_object_map_tree co, categories c, category_translations ct, acs_objects ao, acs_objects aot where co.object_id = :object_id and co.category_id = c.category_id and c.category_id = ao.object_id and c.category_id = ct.category_id and aot.object_id = co.tree_id and ct.locale = :locale order by aot.title, ao.title SELECT category_object_map.category_id FROM category_object_map, categories WHERE object_id = :object_id AND tree_id = :tree_id AND category_object_map.category_id = categories.category_id SELECT com.object_id FROM category_object_map com $join_clause WHERE com.category_id = :category_id $where_clause select object_id from acs_objects where title = :title and object_type = 'category' select t.category_id, c.tree_id, t.locale, t.name from category_translations t, categories c where t.category_id = c.category_id order by t.category_id, t.locale select t.locale, t.name, c.tree_id from category_translations t, categories c where t.category_id = :category_id and t.category_id = c.category_id select tree_id from categories where category_id = :object_id