2. What is the AginityWorkbench?
• The Aginity Workbench is a query tool that
allows to connect to a Netezza Appliance
for development purposes.
• The Aginity Workbench is free and very
easy to use.
• The Aginity Workbench connects to
Netezza via OLEDB or ODBC.
• The Aginity Workbench allows the Netezza
developer to write and test SQL code,
stored procedures, views and other
database objects.
2
3. The Problem
• Many times you are faced with the need to run a query using different date ranges,
or change the filters applied to the WHERE clause.
• Aginity Workbench only allows to DECLARE variables within the body of a STORED
PROCEDURE, which is inconvenient when testing a complex script.
In the example below, if you want to run the query for different titles, you have to
edit the query and change the value to test. This query is very simple but imagine a
more complex script with different variables. How many “find and replace” you have
to execute!
3
4. The Solution : Parameter Substitution
This is where the Parameter
Substitution feature in Aginity
Workbench comes to the rescue.
You can use parameters that follow
the $ParameterName mask.The
feature can be enabled by selecting
the “Enable Parameterized Queries”
checkbox in the Query Options
Window.
4
7. The Solution: Parameter Substitution
To use the parameter substitution feature, create a SQL statement and your
parameter using the $ sign:
7
8. The Solution: Parameter Substitution
When this query is executed, a window pops up to prompt for theTITLE:
Notice the parameter name $title, a section to enter its value and the data type.
8
10. The Solution: Parameter Substitution
In this example, you can use the string data type and enter for example Sr.
10
11. The Solution: Parameter Substitution
Once you click on “OK, the results will show as follows:
11
12. The Solution: Parameter Substitution
If you are running a script and you need to make the table name dynamic or
dynamically build the SQL statement, the parameter substitution feature can be use
as follows:
12
13. The Solution: Parameter Substitution
When you click on “Execute”, Aginity prompts for the $title and $table. In the case
of $table, the parameter has to be defined as Inserted “As-Is” data type.
13
15. Thank you
I hope by talking about this feature in Aginity, I can
make your life as a developer a little bit more easier.
Enjoy!
Connect with me:
15
muguet@rsilink.com
Mary Uguet