2012-11-09 29 views
1

对于.Net 4.0应用程序,我使用ODP.Net 11库中的OracleClient类。经过一些研究,有些人注意到ODP.net库不能处理Windows换行符,但只能使用unix(不能处理\ r)。当我用空格替换每个\ r发生时,查询运行良好。Oracle的ODP.Net无法处理换行符.Net换行符?

我在这里错过了什么东西,还是甲骨文只是荒谬?

,我发现了以下错误:

Message: ORA-06550: line 1, column 6: 
PLS-00103: Encountered the symbol "" when expecting one of the following: 

    begin case declare exit for goto if loop mod null pragma 
    raise return select update while with <an identifier> 
    <a double-quoted delimited-identifier> <a bind variable> << 
    close current delete fetch lock insert open rollback 
    savepoint set sql execute commit forall merge pipe 
The symbol "begin was inserted before "" to continue. 
ORA-06550: line 2, column 90: 
PLS-00103: Encountered the symbol "" when expecting one of the following: 

    begin case declare end exception exit for goto if loop mod 
    null pragma raise return select update while with 
    <an identifier> <a double-quoted delimited-id 
+0

看到这里的http:// WWW。 intertech.com/Blog/Post/Executing-SQL-Scripts-with-OracleODP.aspx –

+1

但这只是一个荒谬的oracle事情......我知道解决方法,但它只是如何可以使oracle做一个库,甚至不支持本机环境设置?对我来说,我知道那里没有一个设置或老版本的工作... – ferdyh

回答

4

/r不ODP.NET支持你必须删除这样的:

+0

是啊,我想通了...但是,它不是疯狂的.Net库不支持Windows换行符? – ferdyh

+1

它通常由Java开发人员开发。 =) – Ewerton

+0

数字......但主要问题是我们使用OleDbConnection并用DbConnection替换了所有的东西。随着这一变化,我们转而使用本地客户端SQLConnection和OracleConnection。查询生成我们使用带有Append和AppendLine的StringBuilders来实现日志记录的可读性。 AppendLine的缺点是它使用了OracleClient没有得到的Environment.NewLine(\ r \ n)......我拒绝走下所有代码并替换\ r,因为imho不应该是一个问题... – ferdyh