postgresql7.1
select workflow_key from glossariesx
where item_id = :glossary_item_id
and revision_id = content_item__get_live_revision(:glossary_item_id)
select workflow_key
from glossariesx g, cr_child_rels ch
where g.item_id = ch.parent_id
and ch.child_id = :item_id
and revision_id = content_item__get_live_revision(g.item_id)
select term, definition, publish_status,
live_revision, latest_revision, name, mime_type,
case acs_permission__permission_p(item_id, :user_id, 'glossary_term_add_illustration')
when 't' then 1
when 'f' then 0
end as illustration_add_p
from glossary_terms_latest
where item_id = :item_id
select acs_object_id_seq.nextval
update cr_revisions
set content = :definition
where revision_id = :revision_id
select content_item__new (
:name,
NULL,
NULL,
NULL,
current_timestamp,
:user_id,
:glossary_item_id,
:peeraddr,
'content_item',
'glossary_term',
NULL,
NULL,
NULL,
NULL,
NULL
);
select content_revision__new(
:term,
NULL,
current_timestamp,
:mime_type,
NULL,
NULL,
:new_item_id,
NULL,
current_timestamp,
:user_id,
:peeraddr
);
update cr_revisions
set content = :definition
where revision_id = :new_revision_id
select acs_object__new(
NULL,
'cr_item_child_rel',
current_timestamp,
NULL,
NULL,
:glossary_item_id
);