Get datatype from values passed as string

前端 未结 5 696
滥情空心
滥情空心 2021-02-04 12:16

I am writing a framework that will connect to many different data source types and return values from these sources. The easy ones are SQL, Access and Oracle. The tougher ones a

5条回答
  •  -上瘾入骨i
    2021-02-04 12:41

    Starting with the narrowest types and working towards the widest may not be the best approach. If I knew anything about the data, I'd start with the most frequently occurring type, and work toward the least. If if did not know that, I'd might or might not do some research to to get an idea of what that might be statistically, if possible. Else I'd just make my best guess. Why test for bit or datetime early if you only expect them to occur once every 10,000 records?

提交回复
热议问题