Could not find or compile MSSQL.DDR

Started by multix, June 17, 2015, 06:20:50 PM

Previous topic - Next topic

multix

Hi. I am trying to use mssql.ddr for run query in an other mssql database, but can't find mssql.ddr in my installation.
I am using centos 7 and tried to reinstall with --with-mssql prefix, but I could not do.
When I try to configure with "--with-mssql", system says :

configure: WARNING: unrecognized options: --with-mssql

Where am I wrong or what must I do?

On the other hand, I tried to compile with --with-odbc prefix, (installed unixODBC):
there is not any error while configuring. but, when I try to use make command, I am getting this error :

In file included from odbc.cpp:23:0:
odbcdrv.h:77:17: fatal error: sql.h: No such file or directory
#include <sql.h>

So, I could not use odbc.ddr, too.

Alex Kirhenshtein

Native MSSQL driver is windows only, you'll have to use unixODBC.

Install unixODBC-devel package to fix this error.

multix

can you give me a sample odbc config for nxagent please. I could not make a config for odbc to run a query for mssql

multix

ok, I am able to connect to MSSQL with odbc.ddr now.

I have one more step to finish :)

when I create a DCI as DB.Query(dbid,query), nxagent says me :
SQL query failed (Query = "onlineuser"): Could not find stored procedure 'online user'.

but when I create a DCIS as DB.QueryResult(name), then everything is ok. I can get result my query.

In first situation, must QUERY be a stored procedure, or am I making something wrong?

thanks.

Victor Kirhenshtein

Hi,

in DB.Query you specify actual SQL query to be executed, like this:

DB.Query(dbid,"SELECT col FROM my_table")

If you specify query in agent's config then it is executed in background and DB.QueryResult returns cached result from last run. Pre-configured queries are good when you have long-running query - if you use it directly server request may fail on timeout. If you have simple query that executes in less than a second you can use DB.Query.

Best regards,
Victor

multix