Closed ravigit94 closed 1 year ago
https://csvkit.readthedocs.io/en/latest/scripts/csvsql.html
echo "Prod_ID,Prod_name,Prod_launch_date
1,Mouse,01/01/2019
2,Keyboard,02/02/2020" | csvsql
CREATE TABLE stdin (
"Prod_ID" DECIMAL NOT NULL,
"Prod_name" VARCHAR NOT NULL,
"Prod_launch_date" DATE NOT NULL
);
See documentation to change SQL dialect, table name, etc.
Hello support community,
Could you please advise if I can generate a DDL command based on the header of a CSV file. I don't need to connect to any database or insert data.
For an example, I have a CSV (Product.csv):
The output should be:
CREATE TABLE PRODUCT ( PROD_ID NUMBER, PROD_NAME VARCHAR(20), PROD_LAUNCH_DATE DATE)
Thank you.