MashZone NextGen 10.2 | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in MashZone NextGen Wires | Creating Mashups in Wires | Add Actions or Other Blocks | Run a SQL Statement
 
Run a SQL Statement
 
Using Input Parameters as SQL Query Parameters
SQL Block Video rectSQL Block Video
Use the SQL block to run a SQL statement for a database that has been configured by your MashZone NextGen administrator. You define the SQL statement that the block should run.
This block can be used as an information source by running a SQL query. You can also use it to run stored procedures or to perform insert, update or delete operations.
Your MashZone NextGen administrator must define a datasource (database connection information) before you can use this block.
MashZone NextGen administrators can also configure MashZone NextGen to reject insert, update or delete operations for a database.
Datasource Name
Select the datasource for the database you want to work with. If there is no datasource for this database, contact your MashZone NextGen administrator to add one.
Enter SQL Statement
Specify the SQL statement for this block. Either:
*Enter the exact SQL statement to run. You can safely include dynamic values for query parameters in this SQL statement using the :input-param-name syntax. See Using Input Parameters as SQL Query Parameters for more information and examples.
*Click to open the Path Selector list and select an input parameter or other node to supply the SQL statement dynamically. See Select Fields or Paths for Block Properties with the Path Selector for more information.
Important: Supplying part of a SQL statement through the Path Selector list or using other blocks, such as String Builder, has some risks as this can allow a type of Internet attack known as SQL Injection.
Statement Type
If the SQL statement is provided dynamically, from an input parameter or other block, set the appropriate option to indicate whether this statement is a Query statement or an Update statement (for insert, update or delete operations).
Limit the number of records to fetch
Set this option if you want to limit the results from this SQL query or stored procedure to a specific set of rows.
This is set by default to fetch the first 20 rows in Wires. This is a good practice in general to help ensure good performance for the mashup.
Fetch records starting at row number
If you have chosen to limit the records to fetch, select or enter the number of the first record to return. Or click to open the Path Selector list and provide this number dynamically from an input parameter or other result. See Select Fields or Paths for Block Properties with the Path Selector for more information.
Maximum number of records to fetch
If you have chosen to limit the records to fetch, select or enter the total number of rows to return.
Or click to open the Path Selector list and provide this number dynamically from an input parameter or other result. See Select Fields or Paths for Block Properties with the Path Selector for more information.
Fetch size to use with database connection
Select or enter the number of records that this mashup should request from this datasource at one time. Or click to open the Path Selector list and provide this number dynamically from an input parameter or other result. See Select Fields or Paths for Block Properties with the Path Selector for more information.
Setting a fetch size is generally a good idea when the dataset for this query may be large. It helps to optimize how the mashup retrieves the results, both to improve performance and ensure adequate memory for the query.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release