随笔 - 61  文章 - 1 评论 - 41 trackbacks - 8
<2007年3月>
25262728123
45678910
11121314151617
18192021222324
25262728293031
1234567

与我联系

搜索

 

常用链接

留言簿(6)

我的标签

随笔分类

随笔档案

文章分类

文章档案

Misc

阅读排行榜

    当Visual Studio 2005的Query Builder遭遇Oracle数据库时,你绝对要疯狂!一条完全能正确运行的语句,会被Query Builder自作聪明地篡改得面目全非,然而这还不是最令人气愤的,最气人的是然后它竟然恬不知耻地告诉你语法错误:

Failed to update CommandText:

 The schema of data returned by your new command could not be retrieved. Schema of table "tableName" was not changed and might not reflect data retrieved by your command. The database returned the following error:

Syntax Error: Expecting ',' or 'WHERE' (etc.) after table alias.



关于这个问题,微软是这样解释的:


PROBLEM:
___________________

When trying to use the Query Builder with Oracle, queries that create INNER JOIN syntax result in an error in Query Builder when trying to generate your schemas.

CAUSE:
___________________

The OracleClient FillSchema method that is called by the Query Builder cannot handle INNER JOIN syntax

RESOLUTION:
___________________
When we updated the Query Builder in VS2005 to generate INNER JOIN syntax when the underlying database can handle it, we did not update the OracleClient to handle the INNER JOIN. Therefore, when the Query Builder tries to call the FillSchema method to generate the INSERT, UPDATE, and DELETE statements, it encounters an error. You would also see this error if you called the FillSchema method directly in code.

Unfortunately, the risk associated with modifying OracleClient.FillSchema to handle the INNER JOIN syntax is too risky to do at this time given, so this change has been postponed until at least Orcas. We are also working with Oracle to try to get them to modify their database to return the schema information automatically instead of forcing the provider to interpolate the schema based on the query. This would eliminate the need for the FillSchema method.

    因此,我迫不及待地下载了Orcas June CTP和NetFramework 3.0 June CTP(注意,虽然截止到目前为止,NetFramework 3.0 July CTP已经发布,但Orcas的最新June CTP还无法与之协同工作),找了台Virtual Server测试了一下,果然问题已经解决,Query Builder不再污蔑我们正确的SQL语句,并且所有的DataSet Scheme都识别得相当准确。

补充:
    也许是碰巧的原因,昨天的那条语句比较幸运,在随后的使用中,我还是发现有许多语句仍然会出现老问题,只是比原来有了改善,希望Orcas正式发布的时候,这些问题都能解决。

另:作为一个微软路线的程序员,遭遇Oracle是很悲哀的一件事,因为大部分时间浪费在了一些与创造力毫不相干的环节上。所谓的Oracle专家,很大程度上是这样一种经验丰富的专业人员,他们知道Oracle在哪种情况下行,在哪种情况下不行,在某些场合应该这样做,某些场合应该那样做。

posted on 2006-08-08 16:27 愚公 阅读(6091) 评论(2)  编辑 收藏 网摘 所属分类: .Net技术数据库技术

FeedBack:
#1楼  2006-08-09 05:50 adf [未注册用户]
还有别的好的地方吗
  回复  引用    
#2楼  2007-03-14 15:53 清新空气      
"因为大部分时间浪费在了一些与创造力毫不相干的环节上"
这句话说的好
  回复  引用  查看