SQL queries behaving strange?

Hello everyone

I am facing a strange behaviour in my postgreSQL.

I have a very simple select query:

SELECT licences.*, offers.id
FROM licences
LEFT JOIN rel_angebot_lizenz ON rel_angebot_lizenz.lizenz_id = lizenzen.id
LEFT JOIN offers ON offers.id = rel_offer_licence.offer_id
WHERE 
  offer.id = {{ selectOffer.selectedItem.offer_id }} 

For example, the column offer.id, which is a uuid, should match this value: 6c2566b8-13aa-4179-9a9c-f09418666c51

But for some reason I always get this error:

The query does not accept a uuid value?!
I had the same problem with other queries and tried the GUI option and it worked there. But there is no GUI option for a select query.

I would be very grateful for any advice or help.

Thanks in advance.

Do you maybe need to make it a string explicitly?

offer.id = "{{ selectOffer.selectedItem.offer_id }}"

Hey @chrituri,
it actually appears as a string when I click on it:

So it is really weird.

I tried to use a static value with these quotation marks:'', like this: '6c2566b8-13aa-4179-9a9c-f09418666c51' instead of "6c2566b8-13aa-4179-9a9c-f09418666c51" and it did work, but I don't know how that's supposed to help me with the dynamic values. It just doesn't make sense to me :confused:

Ok I found the solution. :slight_smile:

I just needed to put ‘’ around the variable and it worked.
It was just a bit strange because I didn't have to put those quotes in other Retool projects.

1 Like