oracle8.1.6 insert into workflow_actions (action_id, workflow_id, sort_order, short_name, pretty_name, pretty_past_tense, edit_fields, assigned_role, always_enabled_p, description, description_mime_type, timeout_seconds) values (:action_id, :workflow_id, :sort_order, :short_name, :pretty_name, :pretty_past_tense, :edit_fields, :assigned_role_id, :always_enabled_p, :description, :description_mime_type, :timeout_seconds) timeout_seconds :attr_timeout_seconds select a.action_id, a.workflow_id, a.sort_order, a.short_name, a.pretty_name, a.pretty_past_tense, a.edit_fields, a.assigned_role as assigned_role_id, (select short_name from workflow_roles where role_id = a.assigned_role) as assigned_role, a.always_enabled_p, (select case when count(*) = 1 then 't' else 'f' end from workflow_initial_action where workflow_id = a.workflow_id and action_id = a.action_id ) as initial_action_p, fa.new_state as new_state_id, (select short_name from workflow_fsm_states where state_id = fa.new_state) as new_state, a.description, a.description_mime_type from workflow_actions a, workflow_fsm_actions fa where a.workflow_id = :workflow_id and fa.action_id = a.action_id and a.action_id = fa.action_id (+) order by a.sort_order select nvl(max(sort_order),0) + 1 from workflow_action_callbacks where action_id = :action_id insert into workflow_action_allowed_roles select :action_id, (select role_id from workflow_roles where workflow_id = :workflow_id and short_name = :allowed_role) as role_id from dual