SELECT (room_id) as new_room_id FROM jb_conference_rooms WHERE name = :roomname INSERT INTO jb_room_start_from_thread (room_id , thread_id) VALUES (:new_room_id , :thread_id) INSERT INTO jb_room_party_map (room_id , party_id) VALUES (:new_room_id , :party_id) UPDATE jb_conference_rooms SET type = 'master' WHERE room_id = :new_room_id