1 grid.execute
This tag executes the SQL provided on nodes of the grid.
<grid.execute
name='name'
timeout='timeout'
>
<select /> ?
<nativesql /> ?
</grid.execute>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Grid name where the query will be executed. | |||
Atimeout | integer | The timeout before cancel the executed query for each database. If it is not specified timeout applied is getted from the definition on database connection group. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eselect | select | Query to execute on nodes on the grid. The arguments allowed in this context are the arguments for tag select. | |||
Enativesql | select | Use nativesql to execute a SQL sentence writted in database grammar. |
Returns | |
---|---|
Type | Description |
String | Returns the result set with the statistics of the execution. |
Example
Copy
<xsql-script> <body> <grid.execute name='grid_demo'> <nativesql> create table t_person( person_id char(10), person_name char(10), person_gender char(10) ) </nativesql> </grid.execute> <print> <grid.execute name='grid_demo'> <nativesql>CREATE UNIQUE INDEX IF NOT EXISTS p_t_person ON t_person(person_id)</nativesql> </grid.execute> </print> </body> </xsql-script>
+---------------+-------+-------+
|_node |_count |_error |
|char |integer|char |
|visible |visible|visible|
+---------------+-------+-------+
|demo_apps_all | 0| |
|demo_chinook_i | 0| |
|demo_foodmart_i| 0| |
+---------------+-------+-------+