select *
from portal_pages
where page_id = :page_id
update portal_pages
set name = :name,
portal_id = :portal_id,
layout_id = :layout_id,
sort_key = :sort_key
where page_id = :page_id
select case when count(*) = 0 then 0 else 1 end
from portal_elements
where page_id = :page_id
and state != 'hidden'
select page_id
from portal_pages
where portal_id = :portal_id
and sort_key = :sort_key
select page_id
from portal_pages
where portal_id = :portal_id
and name = :page_name
select 1
from dual
where exists (select 1
from portal_elements
where page_id = :page_id
and state != 'hidden')
select portal_layouts.filename as layout_filename
from portal_layouts
where portal_layouts.layout_id = :layout_id
select portal_elements.element_id,
portal_elements.region,
portal_elements.sort_key
from portal_elements, portal_pages
where portal_elements.page_id = :page_id
and portal_elements.page_id = portal_pages.page_id
and portal_elements.state != 'hidden'
order by portal_elements.region,
portal_elements.sort_key