select
max (sort_order)
from
ims_cp_items
where
org_id = :org_id
select
sort_order as order, ims_item_id as reorder_item_id
from
ims_cp_items
where
org_id = :org_id
and sort_order >= :sort_order
update
ims_cp_items
set
sort_order = :new_sort
where
ims_item_id = :reorder_item_id
select
item_id
from
cr_items
where
name = :course_name and
parent_id = :root_folder
select
item_id
from
cr_items
where
name = :course_name and
parent_id = :root_ims_folder