Called odbc query from from an xlate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Called odbc query from from an xlate

  • Creator
    Topic
  • #51835
    Mike Campbell
    Participant

      We have a pre-proc that is used to connect to and query database tables using the ODBC connection.

    Viewing 3 reply threads
    • Author
      Replies
      • #71922
        Jim Kosloskey
        Participant

          Mike,

          Cloverleaf 5.6, AIX.

          I have experimented with this and got it to work. This was simply a proof of concept so it really did not do anything other than connect to a source and extract some information.

          That was enough to convince me this was possible. Idid this in March of 2007 but we have not ever used this capability.

          One of the reasons is there are considerations that we did not have time to work out that had nothing to do with the actual access.

          Things like what do you do if the connection is refused? If you sleep to wait a while to try again, that blocks the entire process – not good if this is peak demand period on any volume integration – potential death on a constantly high volume integration.

          How to handle lockouts (kind of the same as above).

          What do you do if the DB never is available or there is an error on the message? Do you error out the message (this could happen with every message making working the Error DB problematic), do you send the message anyway with some kind of default, do you stop everything?

          There are other issues (like what happens if the owner of the DB does not validate their changes – the ODBC activity won’t fail but the wrong data will potentially corrupt lots of messages).

          I think you see the picture.

          However, bottom line this should work for you.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.

        • #71923
          Mike Campbell
          Participant

            Thanks Jim.  

              Positive thinking here….once I get it working as desired, I’ll update the thread with the solution.

          • #71924
            Dirk Engels
            Participant

              Hi Mike,

              this should be no problem. We have done something similar with Java for one of our customers here in Germany. Of course you can do the same in Tcl. Attached you’ll find a sample Java code for this.

              Dirk

            • #71925
              Mike Campbell
              Participant

                Success!  Finally was able to get the proc to work as needed.  

                Now, just to get it to return the ‘PASS’ or ‘FAIL’ to the calling xlate.

                It is close but that part isn’t quite there yet.

                I’ll attach the code here if anyone has need of it.  It is set up to

                query against a Cerner database, but should be able to be modified to use other databases as well.  

                [Some information has been changed to protect the innocent!]

                Thanks to all for the hints and help.

            Viewing 3 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.