insert into chat_rooms ( room_id, pretty_name, description, moderated_p, active_p, archive_p, auto_flush_p, auto_transcript_p, login_messages_p, logout_messages_p, messages_time_window ) values ( :room_id, :pretty_name, :description, :moderated_p, :active_p, :archive_p, :auto_flush_p, :auto_transcript_p, :login_messages_p, :logout_messages_p, :messages_time_window ) update chat_rooms set pretty_name = :pretty_name, description = :description, moderated_p = :moderated_p, active_p = :active_p, archive_p = :archive_p, auto_flush_p = :auto_flush_p, auto_transcript_p = :auto_transcript_p, login_messages_p = :login_messages_p, logout_messages_p = :logout_messages_p, messages_time_window = :messages_time_window where room_id = :room_id insert into chat_transcripts ( transcript_id ,pretty_name ,contents ,description ,room_id ) values ( :transcript_id ,:pretty_name ,:contents ,:description ,:room_id ) update chat_transcripts set pretty_name = :pretty_name, contents = :contents, description = :description where transcript_id = :transcript_id; select room_id from chat_rooms where archive_p = 't' and auto_flush_p = 't' select msg, creation_user, to_char(creation_date, 'DD.MM.YYYY hh24:mi:ss') as creation_date from chat_msgs where room_id = :room_id and msg is not null order by creation_date