How to get multiple result set using executeStoredProcedureForQuery

Hi Community,

Trying to replace store proc. plugin with executeStoredProcedureForQuery, But due to limitation it results only 1000 rows in one result set. 

As per the documentation a!executeStoredProcedureForQuery() Function - Appian 25.3

I have modified custome.proerties file with below settings but still not sure how I should get 10 result set with 1000 rows in each?

conf.executeStoredProcedure.limits.maxRowsPerResultSet=1000

conf.executeStoredProcedure.limits.maxTotalRows=10000

Do I need to change store proc to get multiple result set? 

can we increases more that 10K records using conf.executeStoredProcedure.limits.maxTotalRows configuration?

Thanks in advance.

Bhushan

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Multiple result sets: Different queries, not batches of same data
    Exceed 10K limit: No, maxTotalRows=10000 is usually a hard platform limit. You cannot increase it beyond Appian's maximum.
    Solution for >10K rows: Implement pagination in your stored procedure (pass page number/offset) and call the function multiple times.

  • 0
    Certified Associate Developer
    in reply to Shubham Aware

    Hi  Shubham. I'm calling this plugin in a local variable. Now, I need to replace it with the function as it is deprecated. I need this function to behave the same as plugin. i need more data than 1000 Need help with that. I am putting code here so that it will be understandable easily.

    a!localVariables(
      local!selectedSite: {},
      local!selectedType: {},
      local!selected: false,
      local!finalData: index(
        executestoredprocedure(
          dataSourceName: "jdbc/SPTAM",
          procedureName: "sptam_sp_site_wise_batch",
          inputs: {
            {
              name: "nto",
              type: "VARCHAR",
              value: if(
                or(ri!esoType = "All", ri!esoType = "NTO"),
                "FALSE",
                ""
              )
            },
            {
              name: "eso",
              type: "VARCHAR",
              value: if(
                or(ri!esoType = "All", ri!esoType = "ESO"),
                "TRUE",
                ""
              )
            },
            {
              name: "notFound",
              type: "VARCHAR",
              value: if(
                or(
                  ri!esoType = "All",
                  ri!esoType = "NOT FOUND"
                ),
                "NOT FOUND",
                ""
              )
            },
            {
              name: "pharma",
              type: "VARCHAR",
              value: if(
                contains(
                  ri!companyId,
                  cons!SPTAM_DIVISION_ID_LIST[1]
                ),
                cons!SPTAM_DIVISION_ID_LIST[1],
                ""
              )
            },
            {
              name: "sandoz",
              type: "DATE",
              value: if(
                contains(
                  ri!companyId,
                  cons!SPTAM_DIVISION_ID_LIST[2]
                ),
                cons!SPTAM_DIVISION_ID_LIST[2],
                ""
              )
            },
            {
              name: "toDate",
              type: "DATE",
              value: ri!toDate
            },
            {
              name: "fromDate",
              type: "DATE",
              value: ri!fromDate
            }
          }
        ),
        "result",
        null
      )

Reply
  • 0
    Certified Associate Developer
    in reply to Shubham Aware

    Hi  Shubham. I'm calling this plugin in a local variable. Now, I need to replace it with the function as it is deprecated. I need this function to behave the same as plugin. i need more data than 1000 Need help with that. I am putting code here so that it will be understandable easily.

    a!localVariables(
      local!selectedSite: {},
      local!selectedType: {},
      local!selected: false,
      local!finalData: index(
        executestoredprocedure(
          dataSourceName: "jdbc/SPTAM",
          procedureName: "sptam_sp_site_wise_batch",
          inputs: {
            {
              name: "nto",
              type: "VARCHAR",
              value: if(
                or(ri!esoType = "All", ri!esoType = "NTO"),
                "FALSE",
                ""
              )
            },
            {
              name: "eso",
              type: "VARCHAR",
              value: if(
                or(ri!esoType = "All", ri!esoType = "ESO"),
                "TRUE",
                ""
              )
            },
            {
              name: "notFound",
              type: "VARCHAR",
              value: if(
                or(
                  ri!esoType = "All",
                  ri!esoType = "NOT FOUND"
                ),
                "NOT FOUND",
                ""
              )
            },
            {
              name: "pharma",
              type: "VARCHAR",
              value: if(
                contains(
                  ri!companyId,
                  cons!SPTAM_DIVISION_ID_LIST[1]
                ),
                cons!SPTAM_DIVISION_ID_LIST[1],
                ""
              )
            },
            {
              name: "sandoz",
              type: "DATE",
              value: if(
                contains(
                  ri!companyId,
                  cons!SPTAM_DIVISION_ID_LIST[2]
                ),
                cons!SPTAM_DIVISION_ID_LIST[2],
                ""
              )
            },
            {
              name: "toDate",
              type: "DATE",
              value: ri!toDate
            },
            {
              name: "fromDate",
              type: "DATE",
              value: ri!fromDate
            }
          }
        ),
        "result",
        null
      )

Children
No Data