Home >Database >Mysql Tutorial >How to Selectively Dump SQLite3 Table Data Without the Schema?

How to Selectively Dump SQLite3 Table Data Without the Schema?

Patricia Arquette
Patricia ArquetteOriginal
2025-01-13 15:47:47615browse

How to Selectively Dump SQLite3 Table Data Without the Schema?

Exporting Specific SQLite3 Table Data Without Schema

Need to extract data from specific SQLite3 tables without the schema? This guide shows you how to efficiently export data in SQL or CSV format using command-line tools.

For CSV export (ideal for importing into various applications):

<code>.mode csv
.headers on
.out file.csv
select * from MyTable;</code>

(Note: Use .separator SOME_STRING to change the delimiter if needed, instead of a comma.)

For SQL export (suitable for re-importing into other SQLite databases):

<code>.mode insert <target_table_name>
.out file.sql
select * from MyTable;</code>

This approach allows selective data extraction from chosen tables, omitting the schema for streamlined data handling.

The above is the detailed content of How to Selectively Dump SQLite3 Table Data Without the Schema?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn