ExecuteSQL

Use this component when you need to execute an SQL command that does not return an answer to a query. For example:

  • INSERT
  • UPDATE
  • DELETE
  • CREATE INDEX
  • CREATE VIEW
  • CREATE TABLE
  • ALTER TABLE

Usage

Connection

The component needs an existing connection for the execution, something like this:

MySQLConnection mycon1 = (MySQLConnection) PoolManager.instance().getIPool("myPool").getConnection();
int status1 = mycon1.execute("CREATE TABLE table_name (column1 int, column2 varchar(50), column3 datetime)");

Above we create a MySQL connection called mycon1 which was select in our ExecuteSQL dialog.

Statement

This is the SQL statement that you want to execute. Note that you do not need to include the trailing semicolon. You can supply pretty much any type of SQL but to help you out some standard expressions have been included as templates, just click the Templates... button and you will be presented with a list of options, like:

ALTER TABLE table_name ALTER COLUMN column2 varchar(100)