Databases| SQL| MySQL| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Insert Data From File 
 

Insert Data From File is used to insert data from file.

 

Insert Data From File

                         

Insert Data From File is  used to insert data from file.

Understand with Example

The Tutorial illustrate an example to insert data from file. To understand this example, we create a table 'Stu_Table'. The create table statement is used to construct a table 'Stu_Table' with field attribute and data type.

Create Table Stu_Table

Create Table Stu_Table( Stu_Id int, Stu_Name varchar(15),Stu_Class());

The Table 'Stu_Table' is saved in a file abc.txt.

abc.txt

1 Komal 10
2 Ajay 10
3 Santosh 10
4 Rakesh 10
5 Bhau 10
1 aaa 11
2 bbb 11
3 ccc 11
4 ddd 11
5 eee 11
1 iii 12
2 jjj 12
3 kkk 12
4 lll 12
5 mmm 12

Backup query 

The LOAD DATA  INFILE is used to load the data into a text file 'abc,txt'.

LOAD DATA INFILE 'c:/abc.txt' INTO TABLE stu_table
FIELDS TERMINATED BY ' ';

Table Stu_Table

+--------+----------+-----------+
| Stu_Id | Stu_Name | Stu_Class |
+--------+----------+-----------+
| 1      | Komal    | 10        |
| 2      | Ajay     | 10        |
| 3      | Santosh  | 10        |
| 4      | Rakesh   | 10        |
| 5      | Bhau     | 10        |
| 1      | aaa      | 11        |
| 2      | bbb      | 11        |
| 3      | ccc      | 11        |
| 4      | ddd      | 11        |
| 5      | eee      | 11        |
| 1      | iii      | 12        |
| 2      | jjj      | 12        |
| 3      | kkk      | 12        |
| 4      | lll      | 12        |
| 5      | mmm      | 12        |
+--------+----------+-----------+

                         

» View all related tutorials
Related Tags: sql mysql c string com function fun io sed const char int ai padding length character case cas if ie

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
Software Solutions
Least Viewed
Most Rated
Recently Viewed
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.