Nested Query limit

 7 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
ThomasT
Advanced Member
Posts: 27
Advanced Member
    Trying to see if anyone else can confirm.
    I am writing a new pflow with a total of 4 queries, with each nested within the other.
    It appears that the 4th one, deepest imbedded is not being executed at all. I've looked over the flow carefully.
    Is this correct? Is there a limit on the number of nested queries in processflow?

    Thanks
    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      I can't think of a need to do 4 nested queries. Have you tried using the Related tables within the API (query) Builder to get to the related tables and fields?
      David Williams
      Jason Beard
      Veteran Member
      Posts: 124
      Veteran Member
        Thomas,
        just so it's clear, you basically have 4 dme queries, each building off of data from the prior one and the innermost query is not executing, correct? What does the log file show? Does it list that activity ID at all?
        I have several flows that have 2/3 loops with multiple queries being run in the innermost loop but nothing with 4.
        To David's point, is there a more efficient way to retrieve the data? If a relationship isn't delivered by Lawson, is it something that could be added? Obviously understanding that Lawson may not enforce that relational integrity but if it is "always true" for your site, or you are dealing with custom tables this could be an option. You could also build your select into a view in the DB and then define that view to Lawson so it is accessible via dme. Or if you have PFI, you could build the select via an SQL statement.

        --Jason
        Jason Beard
        617-548-5568
        jabeard3@gmail.com
        ThomasT
        Advanced Member
        Posts: 27
        Advanced Member
          No, it's a complex query... from the app productline to tables in LOGAN,... specifically in WF.
          With 4 queries, the log file only shows 3 queries being executed. Not good.

          I got it down to 3 queries and it seems to be working ok.
          Sam Simpson
          Veteran Member
          Posts: 239
          Veteran Member
            I have a flow that has more than 5 nested DMEs deep and has no problem. This flow is about changes to cost centers which is very involved from LDAP to GL tables.
            Shane Jones
            Veteran Member
            Posts: 460
            Veteran Member
              Sounds like this does not need a resolution anymore but I thought I would add this for someone who might want a creative solution in the future....

              Use a message builder to create a string listing the "select" statement part of a DME or SQL query. Each time it hits the msgbuilder add EMPLOYEE=#####. I am using this in a very complex flow that creates a CSV file to track associate licensing.

              I am using with an SQL query and had to hit the msgbuilder variable twice within the node to add a comma if another record was being added.
              Shane Jones
              Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
              Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
              ** Teach others to fish...
              John Henley
              Posts: 3353
                Do you ever hit (or are you aware of) a max length with the msg builder? When doing loops, have you ever benchmarked it vs. an assign to a javascript variable?=
                Thanks for using the LawsonGuru.com forums!
                John
                Shane Jones
                Veteran Member
                Posts: 460
                Veteran Member
                  I have a couple flows that notify at 250 characters but it is just a notification.... I have a couple flows that create some extremely large msg builders without any issues....
                  Shane Jones
                  Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
                  Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
                  ** Teach others to fish...