--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: dta excerpt: | DuckDB Community Extensions Read and write Stata .dta files (formats 117-121, Stata 13-18) with full type mapping, value labels, and strL support. extension: name: dta description: Read and write Stata .dta files (formats 117-121, Stata 13-18) with full type mapping, value labels, and strL support. version: 0.1.1 language: C++ build: cmake license: MIT maintainers: - korenmiklos repo: github: codedthinking/duckdb-dta ref: 635637253f0954dbd091bfb0a87877ea8cab1787 docs: hello_world: | INSTALL dta FROM community; LOAD dta; -- Read a Stata file SELECT * FROM read_dta('auto.dta'); -- Or use automatic file format detection SELECT * FROM 'auto.dta'; -- Read with value labels converted to DuckDB ENUMs SELECT * FROM read_dta('auto.dta', value_labels=true); -- Write a table to .dta format COPY my_table TO 'output.dta' (FORMAT dta); extended_description: | The dta extension enables DuckDB to **read and write Stata .dta files** natively, supporting formats 117 through 121 (Stata 13--18). **Reading:** - Reads all standard Stata types: byte, int, long, float, double, fixed-length strings, and strL - Converts Stata date (%td) and datetime (%tc) formats to DuckDB DATE and TIMESTAMP - Optionally maps Stata value labels to DuckDB ENUM types with `value_labels=true` - Registers a replacement scan so `.dta` files work directly in FROM clauses **Writing:** - Writes DuckDB tables to format 119 (Stata 15) via `COPY ... TO ... (FORMAT dta)` - Maps DuckDB types to appropriate Stata types, including DATE, TIMESTAMP, and ENUM - Stores long strings as strL entries - Preserves value labels from DuckDB ENUM columns extension_star_count: 2 extension_star_count_pretty: 2 extension_download_count: 11987 extension_download_count_pretty: 12.0k image: '/images/community_extensions/social_preview/preview_community_extension_dta.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ❌ | ❌ | ✅ | ✅ | ❌ | | Linux ARM64 | ❌ | ❌ | ✅ | ✅ | ❌ | | macOS AMD64 | ❌ | ❌ | ✅ | ✅ | ❌ | | macOS ARM64 | ❌ | ❌ | ✅ | ✅ | ❌ | | Windows AMD64 | ❌ | ❌ | ✅ | ✅ | ❌ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ❌ | ❌ | ✅ | ✅ | ❌ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions | function_name | function_type | description | comment | examples | |---------------|---------------|-------------|---------|----------| | read_dta | table | NULL | NULL | | ### Overloaded Functions This extension does not add any function overloads. ### Added Types This extension does not add any types. ### Added Settings This extension does not add any settings.