     ; If this is a record update, so update the internal record
     ; cache
     ; ----------------------------------------------------------------
-    (if (= (get realtime-log-entry :record_operation) "UPDATE")
+    (if (= (get realtime-log-entry (cond (= *database-type* "postgres" ) :record_operation (= *database-type* "oracle") :RECORD_OPERATION)) "UPDATE")
       (do
         (update-record-in-cache  db-table   id)
         (inform-clients-about-record   db-table   id)))

(defn process-log-entry [ realtime-log-entry ]

  (let [
        id-type          (get-id-type (get realtime-log-entry :record_id_type))
        id               (cond (= id-type "INTEGER")  (parse-id  (get realtime-log-entry :record_id))
                               (= id-type "TEXT")     (get realtime-log-entry :record_id))
        db-table         (get realtime-log-entry :record_table_name)
        ]
    ;(println (str "**** Processing realtime record change: "))
    ;(println (str "      "  "realtime-log-entry"))


        coils-trigger-exists   (pos? (count coils-trigger))

        sql-to-insert-trigger-row
        (cond
          (= *database-type* "postgres")
          "INSERT INTO coils_triggers (table_name,version) values (?,?);"

          (= *database-type* "oracle")
          "INSERT INTO coils_triggers (table_name,version) values (?,?)")

        sql-to-create-insert-trigger
        (cond
          (= *database-type* "postgres")
          (str "CREATE TRIGGER trigger_afterInsert AFTER INSERT ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterInsert();")

          (= *database-type* "oracle")
          "create or replace
              trigger Icoils_todo_items
                        BEFORE INSERT ON coils_todo_items
                            FOR EACH ROW
                        BEGIN
                            INSERT INTO coils_realtime_log
                                (record_timestamp, record_table_name,  record_id, record_id_type, record_operation,  record_status)
                            VALUES
                                (LOCALTIMESTAMP, 'coils_todo_items', :NEW.id,
                                (SELECT data_type FROM user_tab_columns WHERE table_name = 'COILS_TODO_ITEMS' AND column_name = 'ID') ,
                                'INSERT',  'WAITING');
                        END;")
        sql-to-create-update-trigger
        (cond
          (= *database-type* "postgres")
          (str "CREATE TRIGGER trigger_afterUpdate AFTER UPDATE ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterUpdate();")

          (= *database-type* "oracle")
          "")

        sql-to-create-delete-trigger
        (cond
          (= *database-type* "postgres")
          (str "CREATE TRIGGER trigger_afterDelete AFTER DELETE ON " table-name " FOR EACH ROW EXECUTE PROCEDURE trigger_function_afterDelete();")

          (= *database-type* "oracle")
          "")
        ]
    ;(println "Coils trigger table exists: " coils-trigger-exists)


    (if (not coils-trigger-exists)
      (do
        (korma.core/exec-raw   [sql-to-insert-trigger-row [table-name  coils-tables-trigger-version]])
        (korma.core/exec-raw   [sql-to-create-insert-trigger []])
        (korma.core/exec-raw   [sql-to-create-update-trigger []])
        (korma.core/exec-raw   [sql-to-create-delete-trigger []])

        )
      nil)))
