No announcement yet.

Event to trigger DB read

  • Filter
  • Time
  • Show
Clear All
new posts

  • Event to trigger DB read

    Hi Guys,

    I have a Channel setup as a Oracle DB reader, and destination is a file writer.

    The basics are connecting, and functioning.
    I can SQL my data out, format a template and dump the output to file.

    But when I view the output folder I have a few hundred output files in just a few seconds, all identical.

    It was a simple 'select p_id, p_name from patients'

    My Source Database polling is set to 5000ms.

    How do I set events/triggers, so the database is only read when an 'event' occurs from my application ??

    Cheers ;-)

  • #2
    Re:Event to trigger DB read

    Mirth is doing exactly what you've asked:

    Each 5 s, a "select p_id, p_name from patients" is done, and for each row selected a file is written.

    You need to 'mark' in some way what rows of the db you've readed. For example, adding a field calleld 'readed' to patients table you can modify your select "select p_id, p_name from patients where readed<>'S'" and add an UPDATE SENTECE (to the ACK field) called 'UPDATE patientes set readed='S' where p_id=${id}'

    But, dflynn, this questions are very well documented at the forum. Perhaps, with a more detailed search you could have a better picture of Mirth in your mind.