Hello,

I am building DBD::ODBC without unicode support.

In dbdimp.c, I have:

      case SQL_VARCHAR: return "VARCHAR";
      case SQL_WCHAR: return "UNICODE CHAR";
#ifdef SQL_WVARCHAR
      case SQL_WVARCHAR: return "UNICODE VARCHAR"; /* added for
SQLServer 7 ntext type 2/24/2000 */
#endif

Shouldn't SQL_WCHAR be included too? i.e.

      case SQL_VARCHAR: return "VARCHAR";
#ifdef SQL_WVARCHAR
      case SQL_WCHAR: return "UNICODE CHAR";
      case SQL_WVARCHAR: return "UNICODE VARCHAR"; /* added for
SQLServer 7 ntext type 2/24/2000 */
#endif

I get the following error otherwise:

dbdimp.c: In function 'odbc_describe':
dbdimp.c:1780: error: 'SQL_WCHAR' undeclared (first use in this function)
dbdimp.c:1780: error: (Each undeclared identifier is reported only once
dbdimp.c:1780: error: for each function it appears in.)
dbdimp.c:1781: error: 'SQL_WVARCHAR' undeclared (first use in this function)
dbdimp.c:1782: error: 'SQL_C_WCHAR' undeclared (first use in this function)
dbdimp.c:1784: error: 'WCHAR' undeclared (first use in this function)
dbdimp.c: In function 'odbc_st_fetch':
dbdimp.c:2401: error: 'SQL_C_WCHAR' undeclared (first use in this function)
dbdimp.c:2402: error: 'SQL_WCHAR' undeclared (first use in this function)
dbdimp.c:2404: error: 'WCHAR' undeclared (first use in this function)
dbdimp.c:2404: error: 'p' undeclared (first use in this function)
dbdimp.c:2404: error: expected expression before ')' token
dbdimp.c:2409: error: expected expression before ')' token
dbdimp.c:2409: error: too few arguments to function 'sv_setwvn'
dbdimp.c: In function '_dbd_get_param_type':
dbdimp.c:2601: error: 'SQL_WCHAR' undeclared (first use in this function)
dbdimp.c:2602: error: 'SQL_WVARCHAR' undeclared (first use in this function)
dbdimp.c:2603: error: 'SQL_WLONGVARCHAR' undeclared (first use in this function)
dbdimp.c:2604: error: 'SQL_C_WCHAR' undeclared (first use in this function)
dbdimp.c: In function '_dbd_rebind_ph':
dbdimp.c:2657: error: 'WCHAR' undeclared (first use in this function)
dbdimp.c:2694: error: 'SQL_C_WCHAR' undeclared (first use in this function)
dbdimp.c:2887: error: expected expression before ')' token
make: *** [dbdimp.o] Error 1

To get it to compile, I made the above change, as well as commenting
out line 1585:
 s_c(SQL_C_WCHAR);
Not the right approach, but it got me going.

Is this a bug, or have I done something monstrously wrong?

Thanks.

Reply via email to