Using Parameters in Advanced Queries With Quotes

Estou a tentar aceder a um linked server tal como vocês explicam nos posts, mas usando um parâmetro da advanced query.

Devido ás plicas não consigo passar parâmetros da query la para dentro...

na imagem tenho hard coded um = 30246 que é o ID e quero passa-lo como @id.
mas como tenho as plicas ele dá sempre erro. já coloquei 1 plica, 2 plicas 3 plicas, aspas e não entendo como solucionar isto.

resumindo eu tenho WHERE REQUEST_ID = 30246 e quero por WHERE REQUEST = @id

já tentei WHERE REQUEST = ' @id ' ...
já tentei WHERE REQUEST = ' + @id + ' ...

etc etc e nada...

também jé mudei a variável de expand_inline entre true e false e nada.

Hello Diogo,

First of all I'm answering in English so that all the community can benefit from your question and also from this answer.

In this case that you expose and since you're constructing a SQL statement that is completely decoupled from the platform (no entities of the eSpace are referenced) you could try to construct the hole SQL string outside the query using the expression editor and then pass it to the advanced query as a parameter. Attention that you'll get a warning when you publish the eSpace since this is a "strange" query to Service Studio.

Important Note: Be very careful with SQL transactional statements in the advanced queries (specially commit statements). In these cases when you test your query the changes will be effectively committed to the database. You can easily do things you didn't expect and that can ruin your data.

Hope this information helps you, Cheers