SQE
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
cursor_proc
Parameters
Name
Type
Mode
Definition
BEGIN DECLARE art_id INT UNSIGNED DEFAULT 0; DECLARE exit_loop BOOLEAN; DECLARE artefact_cursor CURSOR FOR SELECT artefact_id FROM artefact; DECLARE CONTINUE HANDLER FOR NOT FOUND SET exit_loop = TRUE; OPEN artefact_cursor; artefact_loop: LOOP FETCH artefact_cursor INTO art_id; IF exit_loop THEN CLOSE artefact_cursor; LEAVE artefact_loop; END IF; INSERT IGNORE INTO artefact_owner (artefact_id, scroll_version_id) VALUES(art_id, 1); END LOOP artefact_loop; END