Executes SQL statements.
Operation description
You can call this operation only for instances that are managed in Security Collaboration mode.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
dms:ExecuteScript | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DbId | integer | Yes | The ID of the database. Note
This parameter is equivalent to the DatabaseId parameter in the SearchDatabase, ListDatabases, and GetDatabase operations. You can call one of these operations to obtain the required database ID. For more information, see SearchDatabase , ListDatabases , and GetDatabase .
| 123 |
Script | string | Yes | The SQL statements to be executed. Data query language (DQL) statements, data definition language (DDL) statements, and data manipulation language (DML) statements are supported. The control mode of the instance that you want to query determines whether you can execute DDL and DML statements. | select dt from report_daily |
Logic | boolean | Yes | Specifies whether the database is a logical database. | false |
Tid | long | No | The ID of the tenant. Note
To obtain the tenant ID, move the pointer over the profile picture in the upper-right corner of the Data Management (DMS) console. For more information, see Tenant information.
| 234 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "FE8EE2F1-4880-46BC-A704-5CF63EAF9A04",
"Results": [
{
"ColumnNames": [
"col1"
],
"Rows": [
[
{
"col1": "value1",
"col2": "value2"
}
]
],
"Success": true,
"Message": "UnknownError",
"RowCount": 1
}
],
"ErrorCode": "UnknownError",
"ErrorMessage": "UnknownError",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|