NULL vs Empty String for Literal Inputs #14
Answered
by
andyvidan
data-usr
asked this question in
QueryViews
-
|
How do I use a Literal Input, and specifically set to |
Beta Was this translation helpful? Give feedback.
Answered by
andyvidan
Feb 6, 2025
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
data-usr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Let's assume we define a Literal Input for customer as follows:
This will allow us to use {{customer}} as a parameter in our queries.
We can now write a query as:
EXEC dbo.Test_sp @Param1 = {{customer}}This will translate to:
EXEC dbo.Test_sp @Param1 = '<user defined value>'So, for example, on the View page of the QueryView, you will see this input field:
If you put in foo, your query will be set to:
EXEC dbo.Test_sp @Param1 = 'foo'If you leave the input blank, your query will be set to:
EXEC dbo.Test_sp @Param1 = ''Now, in some cases, you may want to have NULL rather than an empty string. For that, use as the default value in the Literal Input settings.
In this case, if the user-d…