closing sqlite db

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf closing sqlite db

  • Creator
    Topic
  • #53255
    Gary Atkinson
    Participant

      Hi all-

      I have proc I am working on that grabs data from an hl7 message and stores into an sqlite database.  In the shutdown mode I have it to close the db handle.  When testing this out, the interpreter complains it can not find the handle.  The handle is created in run mode. Ideas on why that is?

      Code:


      [cmd :cmd :INFO/0:    kevin_cmd:08/30/2012 09:01:21] Doing ‘pstop’ command on thread ‘conn_1’
      [sms :sms :ERR /0:       conn_1:08/30/2012 09:01:21] Tcl error:
             msgId   = none
             proc    = ‘tpsCrispDBFilter’
             args    = ”
             result  = ‘can’t read “db1″: no such variable’
             errorInfo: ‘
      can’t read “db1″: no such variable
         while executing
      “close $db1″
         (”shutdown” arm line 2)
         invoked from within
      “switch -exact — $mode {
                             start {
                             load $env(HCIROOT)/tcl/include/libtclsqlite3.so Sqlite3
                      }

                             run {
                     keylget args MSGI…”
         (procedure “tpsCrispDBFilter” line 18)
         invoked from within
      “tpsCrispDBFilter {CONTEXT sms_ib_data} {ARGS {}} {MODE shutdown} {VERSION 3.0}”‘

    Viewing 2 reply threads
    • Author
      Replies
      • #77065
        Jerry Tilsley
        Participant

          Gary,

          The handle will need to be stored in a global variable in order to be visible by multiple areas (i.e. STARTUP, RUN, SHUTDOWN, TIME).  Once you create the global variable, then you can assign the db handle to in it in the STARTUP or RUN modes and close it in the SHUTDOWN mode.

          Thanks,

          Jerry

        • #77066
          Charlie Bursell
          Participant

            The command should be “db1 close”

            Look at:  http://www.sqlite.org/tclsqlite.html#close

          • #77067
            Gary Atkinson
            Participant

              well don’t I feel stupid now !  ðŸ˜³  thx  8)

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