---
title: CREATE MACRO
description: "CREATE MACRO statement for defining reusable SQL expressions in DuckDB."
---

import PartialExample from '../_include-thing-for-parity-with-duckdb.mdx';

<PartialExample thing="The CREATE MACRO statement" verb="is" url="https://duckdb.org/docs/stable/sql/statements/create_macro" linkText="CREATE MACRO" />


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/sql-reference/duckdb-sql-reference/duckdb-statements/create-macro/",
  "page_title": "CREATE MACRO",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
