Set up of “Advanced Database Lookup”

Clovertech Forums Cloverleaf Set up of “Advanced Database Lookup”

  • Creator
    Topic
  • #119954
    RICK L. PRITCHETT
    Participant

      I am trying to set up a call to a stored procedure and save the reply to a value for parsing.  The reply is pipe delimited.  I am using Cloverleaf 19.1.  Attached are screenshots of the setup.  Will I need to use code to access the variable to make it available for processing or is there a way to assign it from the GUI?

      Attachments:
      You must be logged in to view attached files.
    Viewing 2 reply threads
    • Author
      Replies
      • #119957
        Keith McLeod
        Participant

          I used a tcl proc to filter messages.  Not sure this will help, but my tcl code looked like this.

          set table_output [dblookup $table_name [lindex $componentList $COMPONENT]]

           

          In my case, OBR:3 value was used to lookup in the table….  Then I could use the table_output variable to make decisions with….

          I would think if used in a translate that your response would be put into $xlateOutVals.

           

        • #119958
          Peter Heggie
          Participant

            I am assuming that output table variables with an RS prefix means record set, meaning you could get multiple rows. When you make the call, all the results are returned at once. Each row, if there are multiple rows, is separated by \n or \r, so you will have to split the result into a list (of rows). Then each row will have data items delimited by pipes.

            But if you are really expecting just one value to be returned, then I would expect that the variable name given by the table configurator should start with OUT (meaning it is a stored procedure OUT parameter). But it could alternatively return a value with a SELECT statement at the end of the procedure. So that would be a variable prefixed with RS. The screen shot shows two variables – the return code and the returned data value. If you do need the return code, then leave it like that. You will get both values back in your result and you will need to split that result by the pipe character (you would do that in a statement following the TABLE statement) and use the value at LINDEX $var 1.

            Peter Heggie
            PeterHeggie@crouse.org

          • #119959
            Keith McLeod
            Participant

              Guessing accesCode is a field containing a value from a vrl, what do you end up with in @reply or @_cl_(The other @variable)…..

              Can you then use the @reply as you source and do something with the value contained in @reply?

               

              • #119960
                RICK L. PRITCHETT
                Participant

                  The output is for the variables @return_code and @reply looks like –    0 {}

                   

            Viewing 2 reply threads
            • You must be logged in to reply to this topic.