declare variable in sql runner

  • 23 May 2022
  • 3 replies

Hi guys, I need help.

I'm new to the looker, I would like to know if there is a way to declare variables in sql runner;



3 replies

Userlevel 2

Hi Gabriel!


Could you share with us more details about what kind of activity are you working on?

There is a similar feature I guess it will help you :




Hi Leo, how are you?

thanks for your response!

I don't have access to the database, only the model available in the looker, so I do my queries directly in the looker's sql runner. sometimes I need to create common variables, for example:


url varchar := '';

select * from table t

where t.url = @url;



I don't know if it's possible to do this in SQL Runner, considering that it's just an environment to execute the queries created by the looker itself.



Userlevel 2

I'm doing great! Thanks 4 asking


Well, SQL runner is not designed for development purposes. It is more like "hey let's gonna test this query, if it works then we will jump to lookML code" or exploring schemas/field types.. But not developing. You have a lot of options to use in lookML rather than sql runner