2017-11-07 1 views
1

MSDAORA OleDB Provider에서 다음 SQL을 실행하면 OK가 실행됩니다.MSDAORA에서 OK로 실행되는 SQL이있는 ODAC 공급자의 오류

BEGIN 
MY_PACKAGE_NAME.MY_PROCEDURE_NAME('value1', 'value2'); 
EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE_NAME as select 
    MY_ID ID, 
    MY_NAME NAME 
from 
    MY_OTHER_TABLE'; 
END; 

하지만 다른 이유로 Oracle.DataAccess.dll을 위해 변화하고있어, 지금은이 오류를 얻을 :

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 "" was ignored. 
ORA-06550: line 2, column 52: 
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 
ORA-06550: line 8, column 60: 
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 

내가 잘못하고있는 중이 야 무엇을?


UPDATE :

.NET 코드 인,

Public Function ExecuteNonQuery(ByVal sql As String, Optional ByVal parameters As Dictionary(Of String, Object) = Nothing, _ 
         Optional ByVal transaction As DbTransaction = Nothing) _ 
    As Integer Implements IDataAccess.ExecuteNonQuery 

    Dim cmd As OracleCommand 
    Dim result As Integer = -1 
    cmd = New OracleCommand(sql, conn) 
    cmd.CommandType = CommandType.Text 
    cmd.CommandTimeout = 86400 

    Try 
     result = cmd.ExecuteNonQuery() 
    Catch ex As System.Exception 
     ex.FillDatabaseExceptionData(cmd) 
     Throw 
     'Finally 
     ' CloseCommand(cmd) 
    End Try 
    Return result 

End Function 
+0

.NET 코드 –

+0

도 제공해주세요. 감사합니다. vb.net 코드. 이 OracleCommand는 네임 스페이스 인 Oracle.DataAccess.Client'에서 가져옵니다. – lmcarreiro

답변

2

는 \ n에 대해 명령 텍스트에 \ 연구 \ n을 교체 다음 odp.net does not handle Windows new lines well

sql = sql.Replace(Environment.NewLine, vbLf) 
cmd = New OracleCommand(sql, conn) 
때문에