Line data Source code
1 : #include "common.h"
2 :
3 : /* test SQL_C_DEFAULT with NCHAR type */
4 :
5 : int
6 10 : main(void)
7 : {
8 : char buf[102];
9 : SQLLEN ind;
10 10 : int failed = 0;
11 :
12 10 : odbc_use_version3 = 1;
13 10 : odbc_connect();
14 :
15 10 : CHKBindCol(1, SQL_C_DEFAULT, buf, 100, &ind, "S");
16 10 : odbc_command("SELECT CONVERT(NCHAR(10), 'Pippo 123')");
17 :
18 : /* get data */
19 10 : memset(buf, 0, sizeof(buf));
20 10 : CHKFetch("S");
21 :
22 10 : SQLMoreResults(odbc_stmt);
23 10 : SQLMoreResults(odbc_stmt);
24 :
25 10 : odbc_disconnect();
26 :
27 : /* the second string could came from Sybase configured with UTF-8 */
28 10 : if (strcmp(buf, "Pippo 123 ") != 0
29 0 : && (odbc_db_is_microsoft() || strcmp(buf, "Pippo 123 ") != 0)) {
30 0 : fprintf(stderr, "Wrong results '%s'\n", buf);
31 0 : failed = 1;
32 : }
33 :
34 10 : return failed ? 1 : 0;
35 : }
36 :
|