Query giving error in production, not in staging

  • Goal: I'm trying to migrate my app to the production environment, but one of the queries gives an error when run in production.
  • Steps: I built a query "ListRacksForBled" in staging environment, it worked like a charm. Now I'm trying to run it against our production environment, but I there get an error message "trailing junk after numeric literal at or near "32f"" (see screenshot). It seems like it doesn't recognize that the variable I'm passing to it is of type "UUID".
    I can have it fix in production by enclosing the variable in single quotes, but then I have issues in the staging environment. What could be the cause for it?
  • Details:
    Below, you'll find screenshots of:
  1. The query in the query library
  2. The query run in staging environment
  3. The query run in production environment
1 Like

Hi @xag, Welcome to the Retool Community,

blen_id should be enclosed in either single or double quotes, like this: WHERE b.id = '{{ blen_id }}', since it's a string and the data type of b.id is UUID.

Hello @ZeroCodez ,

Thank you for your prompt answer!
When doing so, it works indeed in production, but I then get an error message in staging. See screenshot below.
Do you have any other idea for me?

1 Like

Could you share a screenshot of your query?

It was included here above

1 Like

Remove the single or double quote from the app, and add on the query. For example:

SELECT 
    r.*, 
    b.name as bled_name, 
    rp.label as rack_type, 
    b.status as bled_status 
FROM racks r 
LEFT JOIN bleds b ON r.bled_id = b.id 
LEFT JOIN rack_positions rp ON r.position_id = rp.id 
WHERE b.id = '{{ bled_id }}'

Hi @xag :wave:

Are you still working on this?