Saving a SQL template
Function
This API is used to store specified SQL statements for future reuse.
URI
- URI format
- Parameter description
Table 1 URI parameter Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
sql |
Yes |
String |
New SQL template. |
|
sql_name |
Yes |
String |
Name of the SQL template you want to save. The name must be unique in the current project. |
|
description |
No |
String |
Description of the SQL template. The value can be an empty string. |
|
group |
No |
String |
Name of the template group |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
is_success |
Boolean |
Whether the request is successful |
|
message |
String |
System prompt. If execution succeeds, the message may be left blank. If the execution fails, the value is the cause of the failure. |
|
sql_id |
String |
ID of the SQL template |
|
group |
String |
Name of the template group |
Example Request
Create a SQL template.
{
"sql": "select * from t1",
"sql_name": "sql1",
"description": "use to select t1",
"group": ""
}
Example Response
{
"is_success": true,
"message": "",
"sql_id": "1994b029-3f76-4281-9e35-e370cb4ee26d1501998934432"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.