tencent cloud

RunSQLScript
Last updated:2025-11-13 20:54:39
RunSQLScript
Last updated: 2025-11-13 20:54:39

1. API Description

Domain name for API request: wedata.intl.tencentcloudapi.com.

This API is used to run an SQL script.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: RunSQLScript.
Version Yes String Common Params. The value used for this API: 2025-08-06.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ScriptId Yes String Script id.
ProjectId Yes String Project ID.
ScriptContent No String Script content. executed by default if not transmitted. requires Base64 encoding if transmitted.
Params No String Advanced running parameter, JSON format base64 encode.

3. Output Parameters

Parameter Name Type Description
Data JobDto Explores data tasks.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Successful Response

Input Example

POST / HTTP/1.1
Host: wedata.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: RunSQLScript
<Common request parameters>

{
    "ScriptId": "971c1520-836f-41be-b13f-7a6c637317c8",
    "ProjectId": "1460947878944567296"
}

Output Example

{
    "Response": {
        "Data": {
            "CreateTime": "2025-09-18 15:28:32",
            "EndTime": "2025-09-18 15:28:42",
            "JobExecutionList": null,
            "JobId": "6820250918152834057",
"JobName": "SQL script execution task"
            "JobType": "EXECUTOR",
            "OwnerUin": "100043952936",
"ScriptContent": "--******************************************************************-- --author: gordonzzhu --create time: 2025-01-14 21:05:48 --View database table information in the left-side [Tables] section --Modify data exploration data source in the top-right corner. --******************************************************************-- SELECT 1;"
            "ScriptContentTruncate": false,
            "ScriptId": "0f2777fa-46d7-42cd-8b59-74ce47a375c0",
            "Status": "S",
            "TimeCost": 10000,
            "UpdateTime": "2025-09-18 15:28:42",
            "UserUin": "100028448903"
        },
        "RequestId": "08955a5f-497f-4bac-bac6-99c75191ffa7"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback