Generate DDL SQL create table statement after scanning CSV file
Asked Answered
M

3

8

Are there any command line tools (Linux, Mac, and/or Windows) that I could use to scan a delimited file and output a DDL create table statement with the data type determined for me?

Did some googling, but couldn't find anything. Was wondering if others might know, thanks!

Memorialist answered 20/9, 2013 at 19:51 Comment(0)
T
5

DDL-generator can do this. It can generate DDL's for YAML, JSON, CSV, Pickle and HTML (although I don't know how the last one works). I just tried it on some data exported from Salesforce and it worked pretty well. Note you need to use it with Python 3, I could not get it to work with Python 2.7.

Tristantristas answered 10/10, 2014 at 19:27 Comment(0)
A
1

You can also try https://github.com/mshanu/idli. It can take csv file as input and can generate create statement with appropriate types.It can generate for mysql, oracle and postgres. I am actively working on this and happy to receive feedback for future improvement

Aili answered 3/3, 2020 at 5:15 Comment(1)
Would it be better to put in more explanation?Planimeter
A
0

Recently I tried this online tool convertcsv.com/csv-to-sql. I did some adjustments but it helped me a lot!

Aubert answered 28/6, 2023 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.