0

我在 oracle 数据库中创建了一个存储过程,它接受以下参数。此存储过程根据企业库数据库跟踪侦听器发送的请求将值添加到表中

Timestamp Date,
      Message VARCHAR2,
      Category VARCHAR2,
      Priority int,
      EventID int,   
      Severity VARCHAR2,
      Title VARCHAR2,
      Machine VARCHAR2,       
      ProcessId varchar2,
      ProcessName VARCHAR2

和我在 web.config 中的格式化程序

<add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}"
        name="Text Formatter" />

我想我正在使用企业库中的格式化程序将确切的参数发送到数据库,但我总是收到一个错误“调用'WRITELOG'时参数的数量或类型错误”所以我想知道是否有办法查看命令执行哪个企业库来调用存储的过程,以便我可以查看并修复错误。我遵循了Alex Oliveira在博客中提到的相同方法

4

1 回答 1

1

我不知道我们是否可以看到 Entrprise 库发送的请求。但是在存储过程中,您缺少“out”参数。数据库跟踪侦听器发送请求并期望得到响应。所以你的存储过程参数应该是这样的

EventID VARCHAR2,
      Priority VARCHAR2,
      Severity VARCHAR2,
      Title VARCHAR2,
      Timestamp Date,
      MachineName VARCHAR2,
      AppDomainName VARCHAR2,
      ProcessID VARCHAR2,
      ProcessName VARCHAR2,
      ThreadName VARCHAR2,
      Win32ThreadId VARCHAR2,
      Message VARCHAR2,
      FormattedMessage NCLOB,
       LogID IN OUT int
于 2014-11-21T15:18:41.903 回答