Difference between revisions of "SQLExecute Command"
From GXtest Wiki
(Created page with "{{Idiomas|Comando SQLExecute|SQLExecute Command}} category:GXtest Commands == SQLExecute ==") |
|||
Line 1: | Line 1: | ||
{{Idiomas|Comando SQLExecute|SQLExecute Command}} | {{Idiomas|Comando SQLExecute|SQLExecute Command}} | ||
− | [[category:GXtest | + | [[category:Comandos GXtest]] |
== SQLExecute == | == SQLExecute == | ||
+ | |||
+ | Employing the SQLExecute command makes possible running an arbitraty SQL query against a database. | ||
+ | It is necessary to provide the following information: | ||
+ | * The data to establish a connection against the database, such as host, name, user, password, etc. | ||
+ | * The SQL Query which we want to run | ||
+ | * The destination folder in which the results will be saved (if any results are returned at all) | ||
+ | |||
+ | |||
+ | An example: | ||
+ | |||
+ | |||
+ | [[Image:EjemploSQLExecute.PNG]] | ||
+ | |||
+ | == Data for the connection == | ||
+ | |||
+ | The information required to establish a connection to a database depends on its engine. A few examples are displayed below, where the database engine and the rest of data needed for the connection are shown (oracle, sqlserver, mysql, db2): | ||
+ | |||
+ | * sqlserver=Data Source=myServer;Initial Catalog=myDatabase;Integrated Security=False;User Id=myUsername;Password=myPassword | ||
+ | * db2= | ||
+ | * oracle= | ||
+ | * mysql=Server=myServerAddress;Port=3306;Database=myDataBase;Uid=myUsername;Pwd=myPassword; | ||
+ | |||
+ | == SQL Query == | ||
+ | |||
+ | The SQL query to be used can be of three types: | ||
+ | |||
+ | * Performs a change in the database, nonetheless, it does not return a value. | ||
+ | * It returns a unique value. In that case, either a variable to save the returned value may be specified, or a datapool/column. | ||
+ | * Returns a set of columns and rows. In that case, it is possible to specify a datapool with the same amount of columns as the returned data. In that way, all of the returned rows are saved in the datapool, deleting the data which was previously available in it. | ||
+ | |||
+ | == Supported Connectors == | ||
+ | *Oracle | ||
+ | *SQLServer | ||
+ | *DB2 | ||
+ | *Mysql (Installing the .Net Client for MySQL is required, and it's available for downloading it from: http://dev.mysql.com/downloads/connector/net/) |
Revision as of 02:07, 8 October 2013
Contents |
SQLExecute
Employing the SQLExecute command makes possible running an arbitraty SQL query against a database. It is necessary to provide the following information:
- The data to establish a connection against the database, such as host, name, user, password, etc.
- The SQL Query which we want to run
- The destination folder in which the results will be saved (if any results are returned at all)
An example:
Data for the connection
The information required to establish a connection to a database depends on its engine. A few examples are displayed below, where the database engine and the rest of data needed for the connection are shown (oracle, sqlserver, mysql, db2):
- sqlserver=Data Source=myServer;Initial Catalog=myDatabase;Integrated Security=False;User Id=myUsername;Password=myPassword
- db2=
- oracle=
- mysql=Server=myServerAddress;Port=3306;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
SQL Query
The SQL query to be used can be of three types:
- Performs a change in the database, nonetheless, it does not return a value.
- It returns a unique value. In that case, either a variable to save the returned value may be specified, or a datapool/column.
- Returns a set of columns and rows. In that case, it is possible to specify a datapool with the same amount of columns as the returned data. In that way, all of the returned rows are saved in the datapool, deleting the data which was previously available in it.
Supported Connectors
- Oracle
- SQLServer
- DB2
- Mysql (Installing the .Net Client for MySQL is required, and it's available for downloading it from: http://dev.mysql.com/downloads/connector/net/)