开发者

How to force scheme.ini to be used for MS Text Driver?

开发者 https://www.devze.com 2022-12-10 18:34 出处:网络
I am creating this huge csv import, that uses the ms text driver, to read the csv file. And I am using ColdFusion to create the scheme.ini in each folder\'s location, where the file has been uploaded

I am creating this huge csv import, that uses the ms text driver, to read the csv file.

And I am using ColdFusion to create the scheme.ini in each folder's location, where the file has been uploaded.

Here is a sample one I am using:

[some_filename.csv]
Format=CSVDelimited
ColNameHeader=True
MaxScanRows=0
Col1=user_id Text width 80
Col2=first_name Text width 20
Col3=last_name Text width 30
Col4=rights Text width 10
Col5=assign_training Text width 1
CharacterSet=ANSI

Then in开发者_如何学JAVA my ColdFusion code, I am doing 2 cfdump's:

<cfdump var="#GetMetaData( csvfile )#" />
<cfdump var="#csvfile#">

The meta data shows that the query has not grabbed the correct data types for reading the csv file.

And the dump of the query to read file, shows that it is missing values, because of Excel we can not force them to use double quotes. And when fields have mixed data types, then it causes our process to not work..

How can I either change the data type inside the query, aka make it use scheme.ini, or update metadata to the correct data type.

I am using a view on information_schema in sql server 2005 to get the correct data types, column names, and max lengths...

Unless I have some kind of syntax error, I can't see why it's not grabbing the data as the correct data type.

Any suggestions?


Funnily, I had the filename spelled wrong, instead of using schema.ini i was having it as scheme.ini.

I hate when you make lil mistakes like this...

Thank You

0

精彩评论

暂无评论...
验证码 换一张
取 消