4
* Description: This module contains UNICODE routines
8
* API functions: SQLColAttributesW, SQLErrorW, SQLGetConnectOptionW,
17
#include "pgapifunc.h"
18
#include "connection.h"
19
#include "statement.h"
21
RETCODE SQL_API SQLErrorW(HENV EnvironmentHandle,
22
HDBC ConnectionHandle, HSTMT StatementHandle,
23
SQLWCHAR *Sqlstate, SQLINTEGER *NativeError,
24
SQLWCHAR *MessageText, SQLSMALLINT BufferLength,
25
SQLSMALLINT *TextLength)
29
char *qst = NULL, *mtxt = NULL;
35
if (MessageText && BufferLength > 0)
37
buflen = BufferLength * 3 + 1;
38
mtxt = malloc(buflen);
40
ret = PGAPI_Error(EnvironmentHandle, ConnectionHandle, StatementHandle,
41
qst, NativeError, mtxt, buflen, &tlen);
43
utf8_to_ucs2(qst, strlen(qst), Sqlstate, 5);
46
SQLULEN tulen = utf8_to_ucs2(mtxt, tlen, MessageText, BufferLength);
47
if (NULL != TextLength)
56
RETCODE SQL_API SQLGetConnectOptionW(HDBC ConnectionHandle,
57
SQLUSMALLINT Option, PTR Value)
59
mylog("[SQLGetConnectOptionW]");
60
CC_set_in_unicode_driver((ConnectionClass *) ConnectionHandle);
61
return PGAPI_GetConnectOption(ConnectionHandle, Option, Value, NULL, 64);
64
RETCODE SQL_API SQLSetConnectOptionW(HDBC ConnectionHandle,
65
SQLUSMALLINT Option, SQLUINTEGER Value)
67
mylog("[SQLSetConnectionOptionW]");
68
if (!ConnectionHandle) return SQL_ERROR;
69
CC_set_in_unicode_driver((ConnectionClass *) ConnectionHandle);
70
return PGAPI_SetConnectOption(ConnectionHandle, Option, Value);
73
RETCODE SQL_API SQLColAttributesW(
76
SQLUSMALLINT fDescType,
78
SQLSMALLINT cbDescMax,
82
mylog("[SQLColAttributesW]");
83
return PGAPI_ColAttributes(hstmt, icol, fDescType, rgbDesc,
84
cbDescMax, pcbDesc, pfDesc);
4
* Description: This module contains UNICODE routines
8
* API functions: SQLColAttributesW, SQLErrorW, SQLGetConnectOptionW,
17
#include "pgapifunc.h"
18
#include "connection.h"
19
#include "statement.h"
21
RETCODE SQL_API SQLErrorW(HENV EnvironmentHandle,
22
HDBC ConnectionHandle, HSTMT StatementHandle,
23
SQLWCHAR *Sqlstate, SQLINTEGER *NativeError,
24
SQLWCHAR *MessageText, SQLSMALLINT BufferLength,
25
SQLSMALLINT *TextLength)
29
char *qst = NULL, *mtxt = NULL;
35
if (MessageText && BufferLength > 0)
37
buflen = BufferLength * 3 + 1;
38
mtxt = malloc(buflen);
40
ret = PGAPI_Error(EnvironmentHandle, ConnectionHandle, StatementHandle,
41
qst, NativeError, mtxt, buflen, &tlen);
43
utf8_to_ucs2(qst, strlen(qst), Sqlstate, 5);
46
SQLULEN tulen = utf8_to_ucs2(mtxt, tlen, MessageText, BufferLength);
47
if (NULL != TextLength)
56
RETCODE SQL_API SQLGetConnectOptionW(HDBC ConnectionHandle,
57
SQLUSMALLINT Option, PTR Value)
59
mylog("[SQLGetConnectOptionW]");
60
CC_set_in_unicode_driver((ConnectionClass *) ConnectionHandle);
61
return PGAPI_GetConnectOption(ConnectionHandle, Option, Value, NULL, 64);
64
RETCODE SQL_API SQLSetConnectOptionW(HDBC ConnectionHandle,
65
SQLUSMALLINT Option, SQLUINTEGER Value)
67
mylog("[SQLSetConnectionOptionW]");
68
if (!ConnectionHandle) return SQL_ERROR;
69
CC_set_in_unicode_driver((ConnectionClass *) ConnectionHandle);
70
return PGAPI_SetConnectOption(ConnectionHandle, Option, Value);
73
RETCODE SQL_API SQLColAttributesW(
76
SQLUSMALLINT fDescType,
78
SQLSMALLINT cbDescMax,
82
mylog("[SQLColAttributesW]");
83
return PGAPI_ColAttributes(hstmt, icol, fDescType, rgbDesc,
84
cbDescMax, pcbDesc, pfDesc);