odbc build for centos/rhel 5.x and ms sql

Started by mjcig, November 19, 2013, 09:01:26 PM

Previous topic - Next topic

mjcig

For testing the product I built and compiled the initial binaries using mysql. All works great and extremely happy with the  product and capabilities after demoing for one of our teams. To review and further prove out the product, we are interested in building the libraries to work with MS SQL server and hoping for some advice.

In the installation doc, ODBC is supported but read the unixODBC package is needed. One question I asked is... must I compile the source with unixodbc to work with MS SQL server backend?  Or will the product only work with Windows and ms sql server?

Additionally, I figured I would attempt to build the files using our DataDirect drivers as these are our firm standard. During the build I receive the following error, see below. 

make[5]: Entering directory `/logs/tmp/netxms/netxms-1.2.9/src/db/dbdrv/odbc'
  CXX    odbc_la-odbc.lo
odbc.cpp: In function 'void* DrvPrepare(ODBCDRV_CONN*, wchar_t*, DWORD*, wchar_t*)':
odbc.cpp:303: error: cannot convert 'short unsigned int*' to 'char*' in initialization
odbc.cpp: In function 'DWORD DrvQuery(ODBCDRV_CONN*, wchar_t*, wchar_t*)':
odbc.cpp:511: error: cannot convert 'short unsigned int*' to 'char*' in initialization
odbc.cpp: In function 'void* DrvSelect(ODBCDRV_CONN*, wchar_t*, DWORD*, wchar_t*)':
odbc.cpp:639: error: cannot convert 'short unsigned int*' to 'char*' in initialization
odbc.cpp: In function 'void* DrvAsyncSelect(ODBCDRV_CONN*, wchar_t*, DWORD*, wchar_t*)':
odbc.cpp:804: error: cannot convert 'short unsigned int*' to 'char*' in initialization
odbc.cpp: In function 'wchar_t* DrvGetFieldAsync(ODBCDRV_ASYNC_QUERY_RESULT*, int, wchar_t*, int)':
odbc.cpp:935: error: cannot convert 'char*' to 'const short unsigned int*' for argument '1' to 'size_t ucs2_to_ucs4(const short unsigned int*, int, wchar_t*, int)'
make[5]: *** [odbc_la-odbc.lo] Error 1


Here is my configure command line argument...
./configure --with-server --with-agent --with-odbc=/tp64/db/DD/7.0.1 --prefix=/opt/netxms-prod CPPFLAGS="-DODBC64 -I/tp64/db/DD/7.0.1/include" LDFLAGS="-L/tp64/db/DD/7.0.1/lib"


Any suggestions or possible options to try to get the files built with this driver? Or do I need to use unixodbc?

Appreciate your help in advance.

Victor Kirhenshtein

Hi!

We never try to build our ODBC driver with anything other then unixODBC on Linux. However, it should work if ODBC API is implemented correctly. Lines with errors looks like this:

SQLWCHAR *temp = UCS2StringFromUCS4String(pwszQuery);

from the error it seems that SQLWCHAR in your ODBC SDK defined to char, not unsigned short as expected. Does DataDirect ODBC implementation support wide character ODBC API? Maybe there should be additional defines to enable it?

Best regards,
Victor

mjcig

I need to take a look further if it does and see what I find. thanks for your response and appreciate the help.