---
schema_version: "1"
id: 3a829c25ca40917f6eb004bdda3a2f76a8b66448b99a986b5e63cc25ffb24189
title: Execute DDL Statements Example
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/db-connector/1.14/database-connector-execute-ddl.md
canonical_url: https://docs.mulesoft.com/db-connector/1.14/database-connector-execute-ddl
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3fc53aceaa66ca14deace70a46820442ab33bb6849598a2b4f70fe86d882f19e
description: MuleSoft Documentation Site
release: "1.14"
latest: false
---
---
product: Database Connector
version: 1.14
---

# Execute DDL Statements Example

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Anypoint Connector for Database (Database Connector) **Execute DDL** operation enables to execute
DDL queries against a database. Data Definition Language (DDL) statements, are special types of SQL
statements that do not directly access or modify data. Instead, they create, modify, or destroy data
structures, stored procedures, and so on. You can also use DDL statements to create or modify data
within tables or other data structures.

## Configure the Execute DDL Operation in Studio

The following example shows how to configure the **Execute DDL** operation that creates a new table
named `electronic` with columns named `id`, `name`, `description`, `price`, and `discount`:

1.  In the **Mule Palette** view, search for `database` and select the **Execute DDL** operation.

2.  Drag the **Execute DDL** operation onto the Studio canvas.  
    The operation creates a table and returns `0` unless there is an error.

3.  In the **General** tab of the operation configuration screen, click the plus sign (**+**) next
    to the **Connector configuration** field to access the global element configuration fields.

4.  Specify the database connection information and click **OK**.

5.  Set the **SQL Query Text** field to the SQL query to execute, for example:

```xml
CREATE TABLE electronic(
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    description VARCHAR(255),
    price SMALLINT,
    discount TINYINT
```

The following screenshot shows the configuration in Studio:

![The Execute DDL operation configuration in Studio](/mulesoft/current/en-us/db-connector/1.14/_images/database-executeddl.png)

Figure 1. Execute DDL configuration

In the XML editor, the `<db:execute-ddl>` configuration looks like this:

```xml
<db:execute-ddl config-ref="dbConfig">
    <db:sql>
        CREATE TABLE electronic(
            id INT AUTO_INCREMENT PRIMARY KEY,
            name VARCHAR(100),
            description VARCHAR(255),
            price SMALLINT,
            discount TINYINT
        )
    </db:sql>
</db:execute-ddl>
```

## See Also

- [Database Connector Examples](https://docs.mulesoft.com/db-connector/1.14/database-connector-examples)

- [Salesforce Help](https://help.salesforce.com)
