(.txt)文件中的数据应上载并保存在数据库表中 [英] data in (.txt) file should be uploaded and Save in database table

查看:55
本文介绍了(.txt)文件中的数据应上载并保存在数据库表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,

我要有一个文本文件,其中包含与数据库相同的结构和数据.

单击上载"按钮,应从位置"中选择文件,并将文件中的数据保存在数据库表中.

问候,
Aamir

Hi friends,

i have a requirement in which there is Text file containing structure and data same as in the database.

the file should be selected from a Location and the data in file should be saved in the database Table on click of a Upload button.

Regards,
Aamir

推荐答案

LOAD DATA INFILE文件路径"
进入表mytable
字段以'';''结尾
以"\ n"终止的行
LOAD DATA INFILE ''path of file''
INTO TABLE mytable
FIELDS TERMINATED BY '';''
LINES TERMINATED BY ''\n''


这篇关于(.txt)文件中的数据应上载并保存在数据库表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆