I have the following sql_exec command outline in my config:

<Output out>
    Module      om_odbc
    ConnectionString    DSN=nxlog;
      sql_exec("INSERT INTO eventlog (hostname) VALUES (?)", '$Hostname');

This is exactly how the 2 examples in the documentation have it set up, I cannot seem to get it to work though I get the following error in my error log:

procedure 'sql_exec()' does not exist or takes different arguments

Can anyone shed any light on why this would be happening or exactly what arguements it is looking for?  Thanks




AskedJuly 13, 2015 - 6:44pm

Answer (1)

The return value of the function sql_exec() needs to be handled so you need to wrap it in an if statement:

Exec if ( sql_exec(...) == TRUE ) {};