Can I automatically create a table in mySQL from a csv file with headers as column names?Export spreadsheet...

What is a DAG (Graph Theory)?

What happens when I Twin Life Transference?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Premature ending of generator in list comprehension

Why zero tolerance on nudity in space?

Explanation of a regular pattern only occuring for prime numbers

Why is it that Bernie Sanders is always called a "socialist"?

How to politely refuse in-office gym instructor for steroids and protein

Plausible reason for gold-digging ant

Has Britain negotiated with any other countries outside the EU in preparation for the exit?

Why does magnet wire need to be insulated?

Is there a defined priority for pattern matching?

Has any human ever had the choice to leave Earth permanently?

I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."

Count repetitions of an array

How to access internet and run apt-get through a middle server?

Why do we have to make "peinlich" start with a capital letter and also end with -s in this sentence?

Why is Agricola named as such?

Can you tell from a blurry photo if focus was too close or too far?

Early credit roll before the end of the film

Cat is tipping over bed-side lamps during the night

Can 5 Aarakocra PCs summon an Air Elemental?

How to deal with possible delayed baggage?

Eww, those bytes are gross



Can I automatically create a table in mySQL from a csv file with headers as column names?


Export spreadsheet and import as table into mysqlHow can I import a CSV file into an SQLite table that doesn't allow null values?User Friendly CSV to MSSQL import with column matchSpreadsheet to MySQLExcel - Find a specific column in a CSV file, and copy to the current sheetHow to automatically import data from csv file and append to existing Excel tableError when importing .xslx/.csv file to MySQL database.csv file from Excel vs .csv file from Libre Officeload csv file into mysql using batch?“character encoding hell”- Configuring mariadb for utf8 end to end













0















I would like to import data from a CSV file with column headers into a database. I can do this with the COPY statement, but only if I first manually create a table with a column for each column in the CSV file. Is there any way to automatically create this table based on the headers in the CSV file?



here below is the query for to load csv into mysql table t1 in which t1 is already created in database manually



load data local infile "C:\EQA\project\input1.csv" 
into table request_table
character set latin1
fields terminated by','
ENCLOSED BY '"'
lines terminated by'rn'
IGNORE 1 ROWS


but i am actually looking to generate table based on csv headers is that possible?
here my requirement is evertime when i export some data from other database like oracle i a able to store it into csv now i need to import this csv into other database like mysql if it is for one time we can do manually to create table in mysql what if i get many csv files from oracle databse? if i follow manually creating table it leads more complexity right!is ther any better case available if so can u please help me










share|improve this question

























  • I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

    – davidgo
    Feb 23 at 9:54
















0















I would like to import data from a CSV file with column headers into a database. I can do this with the COPY statement, but only if I first manually create a table with a column for each column in the CSV file. Is there any way to automatically create this table based on the headers in the CSV file?



here below is the query for to load csv into mysql table t1 in which t1 is already created in database manually



load data local infile "C:\EQA\project\input1.csv" 
into table request_table
character set latin1
fields terminated by','
ENCLOSED BY '"'
lines terminated by'rn'
IGNORE 1 ROWS


but i am actually looking to generate table based on csv headers is that possible?
here my requirement is evertime when i export some data from other database like oracle i a able to store it into csv now i need to import this csv into other database like mysql if it is for one time we can do manually to create table in mysql what if i get many csv files from oracle databse? if i follow manually creating table it leads more complexity right!is ther any better case available if so can u please help me










share|improve this question

























  • I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

    – davidgo
    Feb 23 at 9:54














0












0








0








I would like to import data from a CSV file with column headers into a database. I can do this with the COPY statement, but only if I first manually create a table with a column for each column in the CSV file. Is there any way to automatically create this table based on the headers in the CSV file?



here below is the query for to load csv into mysql table t1 in which t1 is already created in database manually



load data local infile "C:\EQA\project\input1.csv" 
into table request_table
character set latin1
fields terminated by','
ENCLOSED BY '"'
lines terminated by'rn'
IGNORE 1 ROWS


but i am actually looking to generate table based on csv headers is that possible?
here my requirement is evertime when i export some data from other database like oracle i a able to store it into csv now i need to import this csv into other database like mysql if it is for one time we can do manually to create table in mysql what if i get many csv files from oracle databse? if i follow manually creating table it leads more complexity right!is ther any better case available if so can u please help me










share|improve this question
















I would like to import data from a CSV file with column headers into a database. I can do this with the COPY statement, but only if I first manually create a table with a column for each column in the CSV file. Is there any way to automatically create this table based on the headers in the CSV file?



here below is the query for to load csv into mysql table t1 in which t1 is already created in database manually



load data local infile "C:\EQA\project\input1.csv" 
into table request_table
character set latin1
fields terminated by','
ENCLOSED BY '"'
lines terminated by'rn'
IGNORE 1 ROWS


but i am actually looking to generate table based on csv headers is that possible?
here my requirement is evertime when i export some data from other database like oracle i a able to store it into csv now i need to import this csv into other database like mysql if it is for one time we can do manually to create table in mysql what if i get many csv files from oracle databse? if i follow manually creating table it leads more complexity right!is ther any better case available if so can u please help me







batch-file mysql csv sql-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 mins ago







seepana avinash

















asked Feb 23 at 6:15









seepana avinashseepana avinash

424




424













  • I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

    – davidgo
    Feb 23 at 9:54



















  • I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

    – davidgo
    Feb 23 at 9:54

















I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

– davidgo
Feb 23 at 9:54





I would comment that what you are calling a script is actually a query - a script is a set of commands which I surmise would create additional queries which would create the table first. This is definately technically doable, but I don't do Windows, and prefer Postgres to MySQL, so can't be of much assistance on exactly how its done.

– davidgo
Feb 23 at 9:54










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1408693%2fcan-i-automatically-create-a-table-in-mysql-from-a-csv-file-with-headers-as-colu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1408693%2fcan-i-automatically-create-a-table-in-mysql-from-a-csv-file-with-headers-as-colu%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...