postgresql7.1
SELECT MAX(assessment_id) FROM as_assessments
INSERT INTO as_assessments (assessment_id, name, definition)
VALUES (:as_assessments__assessment_id, :as_assessments__name, :as_assessments__definition)
SELECT MAX(section_id) FROM as_sections
INSERT INTO as_sections (section_id, name, definition)
VALUES (:as_sections__section_id, :as_sections__name, :as_sections__definition)
INSERT INTO as_assessment_section_map (assessment_id, section_id)
VALUES (:as_assessments__assessment_id, :as_sections__section_id)
INSERT INTO as_items (item_id, item_display_type_id, name, item_text)
VALUES (:item_id, :as_item__display_type_id, :as_items__name, :as_items__item_text)
INSERT INTO as_item_choices (choice_id, name, choice_text)
VALUES (:choice_id, :as_item_choices__choice_text, :as_item_choices__choice_text)
INSERT INTO as_item_choice_map (item_id, choice_id, sort_order)
VALUES (:item_id, :choice_id, :sort_order)
INSERT INTO as_item_section_map (item_id, section_id)
VALUES (:item_id, :section_id)