2017-11-07 8 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

odp.net does not handle Windows new lines well

sql = sql.Replace(Environment.NewLine, vbLf) 
cmd = New OracleCommand(sql, conn) 
ので、\ rを\ nは\ nに対してコマンド・テキストに置き換えています
関連する問題