Using Parameters in your Query

Parameters can be used in Aginity Pro by using the $ in any part of a SQL statement. When you execute a query the Aginity Pro application will ask you to fill in the value of the parameter before it sends the query to the database.

1
2
3
4
5
6
--sample parameter query

select *
from landing_dim_customer
where gender = $fill_in_gender_at_runtime
limit 100;

You will have datatype choices at runtime as shown in the table below.

Parameter Data Type Action Taken
As Is Aginity Pro will send the value exactly as written with no casting. This is often used when using the parameter to fill in database table or column names.
 
Hint
You can specify default values with parameters by using this syntax with your parameter $fill_in_gender_at_runtime{‘M’}

When you run the query you will see the little gear icon as shown below. Clicking that will populate the default value.

mceclip2.png

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

Comments

0 comments

Please sign in to leave a comment.