Hi guys,
Trying to set up an Oracle DB target in nLog 2.1 using .NET 4.5
I have a stored procedure within a package that I'm calling, passing in a bunch of XML as the "message."
I have compiled and verified this stored procedure by calling it manually from SQL Developer, and it works. But calling it from nLog I get the following error:
Error Error when writing to database System.Data.OracleClient.OracleException (0x80131938): ORA-01036: illegal variable name/number
at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)...
My nLog config (slightly sanitized)
<?xml version="1.0" encoding="utf-8" ?>
<nlog throwExceptions="true" internalLogFile="c:\\code\\nlog.txt" internalLogLevel="Error"
<!--
for information on customizing logging rules and outputs.
-->
<targets>
<target type="Database"
name="database"
dbProvider="System.Data.OracleClient"
connectionstring="Data Source=dbtnsname;User Id=username;Password=password;">
<commandText>
EXEC logging_package.HandleLogMessages @MessageXML
</commandText>
<parameter name="MessageXML" layout="${message}"/>
</target>
</targets>
<rules>
<logger name="*" minLevel="Info" writeTo="database"/>
</rules>
</nlog>
The procedure in Oracle is defined as:
Create or replace PACKAGE BODY LOGGING_PACKAGE IS
PROCEDURE HandleLogMessages
(MessageXML IN CLOB)
IS
BEGIN ...
Any help appreciated, thank you!