2012-11-09 30 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