Query lambda "not executable"

When I update Query Lambda , SQL query runs perfectly but when I save and update it shows “not executable”. Facing this issue for quite some time.

Can anyone help me with this?
Thanks

Hi @sparsh

Investigating now-- I am able to reproduce the same error as you’re showing. Thanks for reporting.

–n

@sparsh

Before you save the query lambda

  1. what does your sql look
  2. what does it say on the pop up box, right before you save the query lambda?

thanks,
n

SQL query →

select
    x.*,
    c.clinic_name,
    p.plan_name,
    p.first_name,
    p.last_name,
    p.mobile,
    p.advisor_did,
    p.advisor_email,
    p.lead_stage,
    p.lead_type
from
    (
        SELECT
            e.eid,
            e.sid,
            e.uid,
            e.pid,
            e.cid,
            e.event_status,
            e.patient_checkedin,
            e.planning_done,
            e.checkedin,
            e.start_time,
           e.purpose
        from
            com.event as e
        where
            (
                consult_type = 'physical'
                AND event_type = 'clinic'
                and e.start_time >= :start_time_min
                and e.start_time <= :start_time_max
                AND (
                    (
                        :exclude_cancelled
                        AND (
                            e.event_status is null
                            or e.event_status != 'cancelled'
                        )
                    )
                    OR (NOT :exclude_cancelled)
                )
            )
        ORDER BY
            e.start_time DESC
        Limit
            :limit OFFSET :offset
    ) x
    left join com.clinic c ON x.cid = c.cid
    LEFT JOIN com.plan p on x.pid = p.pid

I have added e.purpose only in the new sql squery

pop up box before saving lambda

but if you are going by that logic then current query also should show not executable but it does not

thanks for sharing! taking a look.

HI @sparsh

We have a fix coming up for this specifically using parameters in LIMIT clauses by the end of the week (EOW)! If you want to quickly update your param for the limit for now and keep it to a constant- and I can update this thread when the fix is in prod.

Let me know if this resolves the issue or if other errors pop up.

Thanks again for reporting!

–n

Hi @nandine
I have one more query lambda athome-appointments
SQL query is almost same for this lambda as the previous one
but for this one it does not show “not executable”

How is the behaviour different then for 2 query lambda with almost same sql query

SQL query for athome-appointments

SELECT
    x.*,
    p.plan_name,
    p.first_name,
    p.last_name,
    p.mobile,
    p.advisor_did,
    p.advisor_email,
    p.lead_stage,
    p.lead_type
FROM(
        SELECT
            e.uid,
            e.sid,
            e.pid,
            e.eid,
            e.event_status,
            e.patient_checkedin,
            e.planning_done,
            e.checkedin,
            e.start_time,
            e.address,
            e.pincode,
            e.city,
  			e.purpose
        FROM
            com.event e
        WHERE(
                consult_type = 'home'
                AND event_type = 'clinic'
                and e.start_time >= :start_time_min
                and e.start_time <= :start_time_max
                AND (
                    (
                        :exclude_cancelled
                        AND (
                            e.event_status is null
                            or e.event_status != 'cancelled'
                        )
                    )
                    OR (NOT :exclude_cancelled)
                )
            )
    ) x
    LEFT JOIN com.plan p ON x.pid = p.pid

Hi @sparsh

Can you show the pop-up box before you save the query lambda?

this query also have limit clause

Looking into this now-

Hi @sparsh,

I talked with our product engineering, and we have some fixes coming up in a few days that should resolve the inconsistencies you’re seeing. I’ll let you know when it’s deployed to see if this resolves it.

Please let me know if there are errors/bugs that come up.

Best,
n