• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

COUNT attempt exception encountered on cursor prepare/open

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • COUNT attempt exception encountered on cursor prepare/open

    Hello,
    I had noticed some logs that mention 'COUNT attempt exception encountered on cursor prepare/open'. I don't know if it's actually causing any issues as the app seems to behave fine, but I thought I'd mention it.

    Here is a log after I was able to replicate the log that mentions the exception:

    Code:
    COUNT attempt exception encountered on cursor prepare/open.< br > < br > Counting statement:
    select
    count(1)
    from
    (
    WITH customerflags AS (
    SELECT
    *
    FROM
    nuptesttb
    )
    SELECT
    DISTINCT cust#,
    customers.cust AS cust_name,
    customerflags.mybool AS cust_flag
    FROM
    nuptesttb2 AS customers
    JOIN customerflags ON customerflags.myid = customers.cust#
    ) temp < br > < br > Original statement: WITH customerflags AS (
    SELECT
    *
    FROM
    nuptesttb
    )
    SELECT
    DISTINCT cust#,
    customers.cust AS cust_name,
    customerflags.mybool AS cust_flag
    FROM
    nuptesttb2 AS customers
    JOIN customerflags ON customerflags.myid = customers.cust#?
    It looks like the count statement does not put the WITH clause in the right spot for selecting the count. If I remove the DISTINCT keyword in the data source then it fixes the exception log issue and it instead logs:

    Code:
    COUNT statement: WITH customerflags AS (SELECT * FROM nuptesttb ) SELECT count(1) FROM nuptesttb2 AS customers JOIN customerflags  ON customerflags.myid = customers.cust#
    Which appears to now put the WITH clause into the correct spot to make it a valid SQL statement. This happens on a grid that has the Infinite Scroll option checked.

    Thank you!



  • #2
    Can you please respond with just your SQL data source statement? Thanks

    Comment


    • #3
      Here it is:
      Code:
      WITH customerflags AS (
        SELECT
          *
        FROM
          nuptesttb
      )
      SELECT
        DISTINCT cust#,
        customers.cust AS cust_name,
        customerflags.mybool AS cust_flag
      FROM
        nuptesttb2 AS customers
        JOIN customerflags ON customerflags.myid = customers.cust#?

      Comment

      Working...
      X