Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
Mysql CSV 
 

The LOAD DATA INFILE statement provides you the way to import data from a plain text file into database.

 

Mysql CSV

                         

The LOAD DATA INFILE statement provides you the way to import data from a plain text file into database. Mysql CSV is used to load the text file and add to the table in database have the same format 

Understand with Example

The Tutorial provides you an elaborate example on Mysql CSV. To understand and grasp example, we create a text file 'C:/g.csv' and load this text file into table employee12 that has same format as of  text file g.csv.

data inline : The keyword is used to import the data from text file to database in Mysql.

Query for loading table data from csv file:

mysql> load data infile "C:/g.csv"
    ->  into table employee12
    ->  fields terminated by "\t"
    ->  lines terminated by "\n"
    ->  ;
Query OK, 6 rows affected (0.05 sec)
Records: 6  Deleted: 0  Skipped: 0  Warnings: 0

Query for viewing loaded data of table named employee12:

mysql> select * from employee12;
+-------+----------+--------+------------+
| Empid | Empname  | Salary | DOB        |
+-------+----------+--------+------------+
|     1 | Habib    |   2014 | 2004-12-02 |
|     2 | Karan    |   4021 | 2003-04-11 |
|     3 | Samia    |     22 | 2008-02-23 |
|     4 | Hui Ling |     25 | 2008-10-15 |
|     5 | Yumie    |     29 | 1999-01-26 |
|    10 | NULL     | 210000 | 2009-01-12 |
+-------+----------+--------+------------+
6 rows in set (0.01 sec)

 

                         

» View all related tutorials
Related Tags: sql mysql c table sed tab if ie record records to ci e use trie pe from m tr spec

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.