postgresql7.1
select news__archive(
:id, -- item_id
:when -- archive_date
);
select news__make_permanent(:id);
select news__delete(:id);
select cn.*,
ci.item_id,
cr.content,
cr.title,
cr.mime_type,
cr.description,
to_char(o.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified
from cr_news cn,
cr_revisions cr,
cr_items ci,
acs_objects o
where cn.package_id=:summary_context_id
and cr.revision_id=cn.news_id
and cn.news_id=o.object_id
and cr.item_id=ci.item_id
and cr.revision_id=ci.live_revision
order by o.last_modified desc
limit $limit