Using Parameters in your Query

In Aginity, you can apply various parameters in the queries:

  1. To do so, insert the $symbol in any part of your SQL statement.
  2. When you execute a query, the application will ask you to fill in a parameter's value before sending a query to a database.
1 --sample parameter quer
2
3 select *
4 from landing_dim_customer
5 where gender = $fill_in_gender_at_runtime
6 limit 100;
  1. The application will provide you with the following data type at runtime:

Parameter Data Type

Action Taken

As Is

Aginity will send entered value exactly as written, with no casting. This feature often helps when you use a parameter to fill in the database table or column names.

  1. You can specify default values by using this syntax with your parameters:

$fill_in_gender_at_runtime{β€˜M’}

When you run a query with all your parameters, you'll see the little gear icon as shown below. Click on it to populate the default value if needed.

mceclip0.png

πŸ”Ž Note: If you're using a column with the text format, please, keep in mind that you need to add β€˜β€™ or β€œβ€ symbols into the designated field in the Run query with parameters pop-up.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request