如果我的表具有相同的数据库结构,我如何检查文件Excel [英] How Can I Check File Excel If Have Same Structure Of My Table Into Database

查看:64
本文介绍了如果我的表具有相同的数据库结构,我如何检查文件Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



i想要从excel文件中提取数据到我的数据库表中提取数据我想检查excel文件是否具有相同的结构例如:



excel文件:id |名字|年龄

01 | stef | 24

这是valide,因为在我的桌子上Pers我有id,姓名,年龄



但是如果我有这样的excel文件



名称| id |年龄

stef | 01 | 24

不是valide



plz如何检查和坦克

hello,

i want o extract data from excel file to my table in database befor extracting data i want to check if the excel file has the same structure for exemple:

excel file : id | name | age
01 | stef | 24
this's valide because in my table Pers i have id,name,age

but if i have excel file like this

name|id|age
stef|01|24
is not valide

plz how can i check and tanks

推荐答案

您可以使用
$ b $查询目标数据库表的行b

GetSchema和Schema Collections [ ^ ]



因此,请使用您使用的任何内容来读取Excel文件,并确保列名称和顺序与表模式匹配。如果您对特定问题有更具体的问题,那么您的问题更多地是一个模糊的需求列表而不是实际问题,然后更新您的问题以反映这一点。
You can query the rows of the target database table using

GetSchema and Schema Collections[^]

So use whatever you use to read the Excel file and make sure the column names and order match the table schema. Your question is more of a vague list of requirements than an actual question, if you have a more specific question about a specific problem then update your question to reflect that.


这篇关于如果我的表具有相同的数据库结构,我如何检查文件Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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