All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DMS::ScriptExecution

Last Updated:Dec 04, 2025

The ALIYUN::DMS::ScriptExecution type executes SQL scripts.

Syntax

{
  "Type": "ALIYUN::DMS::ScriptExecution",
  "Properties": {
    "DbId": Integer,
    "Logic": Boolean,
    "Script": String,
    "Tid": Integer
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

DbId

Integer

Yes

No

The database ID.

Note

This parameter corresponds to the `DatabaseId` parameter in API operations such as SearchDatabase, ListDatabases, and GetDatabase. You can call these operations to obtain the database ID.

Logic

Boolean

Yes

No

Indicates whether the database is a logical database.

None

Script

String

Yes

No

The SQL script to execute.

The script can include Data Query Language (DQL), Data Definition Language (DDL), and Data Manipulation Language (DML) statements. The ability to execute DDL and DML statements depends on the security control configuration of the instance.

Tid

Integer

No

No

The tenant ID.

None

Return value

Fn::GetAtt

None

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Script:
    Type: String
    Description:
      en: The SQL script to execute. The script can include Data Query Language (DQL), Data Definition Language (DDL), and Data Manipulation Language (DML) statements. The ability to execute DDL and DML statements depends on the security control configuration of the instance.
    Required: true
    Default: select dt from report_daily
  DbId:
    Type: Number
    Description:
      en: |-
        The database ID.
        > Note: This parameter corresponds to the `DatabaseId` parameter in API operations such as `SearchDatabase`, `ListDatabases`, and `GetDatabase`. You can call these operations to obtain the database ID.
    Required: true
  Logic:
    Type: Boolean
    Description:
      en: Indicates whether the database is a logical database.
    Required: true
Resources:
  ScriptExecution:
    Type: ALIYUN::DMS::ScriptExecution
    Properties:
      Script:
        Ref: Script
      DbId:
        Ref: DbId
      Logic:
        Ref: Logic
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Script": {
      "Type": "String",
      "Description": {
        "en": "The SQL script to execute. The script can include Data Query Language (DQL), Data Definition Language (DDL), and Data Manipulation Language (DML) statements. The ability to execute DDL and DML statements depends on the security control configuration of the instance."
      },
      "Required": true,
      "Default": "select dt from report_daily"
    },
    "DbId": {
      "Type": "Number",
      "Description": {
        "en": "The database ID.\n> Note: This parameter corresponds to the `DatabaseId` parameter in API operations such as `SearchDatabase`, `ListDatabases`, and `GetDatabase`. You can call these operations to obtain the database ID."
      },
      "Required": true
    },
    "Logic": {
      "Type": "Boolean",
      "Description": {
        "en": "Indicates whether the database is a logical database."
      },
      "Required": true
    }
  },
  "Resources": {
    "ScriptExecution": {
      "Type": "ALIYUN::DMS::ScriptExecution",
      "Properties": {
        "Script": {
          "Ref": "Script"
        },
        "DbId": {
          "Ref": "DbId"
        },
        "Logic": {
          "Ref": "Logic"
        }
      }
    }
  }
}