postgresql7.1 select case when count(*) = 0 then '0' else '1' end from survey_sections where section_id = :section_id select survey_section__new ( :section_id, :survey_id, :name, :description, :description_html_p, :sort_key, :branch_p, FALSE, FALSE, :page_break_p, :user_id, :survey_id, :pretty_id );