Database Statements

You can use statements to either update or query a database.

Note: You can have 100 database connections with a total of 500 statements.

Writing Statements

You use the Designer tab to develop statements to execute.

PropertyValueDescription
Statement TypeN/ASpecifies the type of statement you want to execute. Use the drop-down list to select from one of the following types:
  • Query, to select data
  • Update, to insert, update, and delete data
    Note: If you choose Query (to select data) after the Update query, the query to select does not run.
ProviderN/ASpecifies the data provider that you want to connect to. Use the drop-down list to select from one of the following providers:
  • SQL Data Provider
  • ODBC Data Provider
    Note: For ODBC, you cannot have more than one query.
StatementStringSpecifies the text that defines the statement. Use a different parameter placeholder depending on the data provider that you select:
  • SQL uses @
  • ODBC uses ?
Parameter placeholders are delimited by spaces. For example: Select * from EMPLOYEE where EMPID = @ID;
Note: Data transfer limit: 10 MB.
Create ParametersN/AWhen you write a statement, click Create Parameters to add parameters automatically to the parameters list.
AddN/AClick to add a new parameter to the list. Select a field to change the properties of the parameter:
  • In the Name column, enter a parameter name.
  • In the DataType column, use the drop-down list to select the related data type.
DeleteN/AClick to remove a parameter from the list. Select a row or rows, and then click this button.

Testing Statements

You can test the statements developed in the Designer. You can call the service provider method using the statement and an existing connection in the data model. You can also specify test parameter values. The results, such as statement execution time and error messages, are displayed when the test completes.
Note: For more information on ODBC error messages, go to:

http://technet.microsoft.com/en-us/library/aa937531(v=sql.80).aspx

PropertyValueDescription
InputsN/ASpecifies the parameter name and value based on the designed statements.
ConnectionN/AClick the Browse button to open the Universal Browser, and then select a server to connect to.
TestN/AClick the Test button to test the statements.
CAUTION: Statements are executed against a specified connection, which may result in loss of data.
OutputsN/ASpecifies the statement data that is returned after execution. When there are multiple queries as part of the database statement, the output consists of a collection of result sets. You can select information from the results set drop-down list to display the specific results in the data grid. If you change the connection, the outputs also change. Outputs include:
  • Execution Status
  • Execution Time
  • Rows Affected/Returned

Depending on the statement type, outputs can be either Rows Affected or Rows Returned. When the statement type is:

  • Query, then the output specifies the result set(s), which are displayed in the table and the total number of Rows Returned are also displayed.
  • Update, then the output specifies the Rows Affected.