3 /**************************************************
6 * These should be consistent with the MS version.
8 **************************************************/
16 #define SQL_WCHAR (-8)
17 #define SQL_WVARCHAR (-9)
18 #define SQL_WLONGVARCHAR (-10)
19 #define SQL_C_WCHAR SQL_WCHAR
22 #define SQL_C_TCHAR SQL_C_WCHAR
24 #define SQL_C_TCHAR SQL_C_CHAR
27 #define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */
29 /* UNICODE versions */
31 SQLRETURN SQL_API
SQLColAttributeW(
36 SQLSMALLINT cbCharAttrMax
,
37 SQLSMALLINT
*pcbCharAttr
,
40 SQLRETURN SQL_API
SQLColAttributesW(
43 SQLUSMALLINT fDescType
,
45 SQLSMALLINT cbDescMax
,
49 SQLRETURN SQL_API
SQLConnectW(
56 SQLSMALLINT cbAuthStr
);
59 SQLRETURN SQL_API
SQLDescribeColW(
63 SQLSMALLINT cbColNameMax
,
64 SQLSMALLINT
*pcbColName
,
65 SQLSMALLINT
*pfSqlType
,
67 SQLSMALLINT
*pibScale
,
68 SQLSMALLINT
*pfNullable
);
71 SQLRETURN SQL_API
SQLErrorW(
76 SQLINTEGER
*pfNativeError
,
78 SQLSMALLINT cbErrorMsgMax
,
79 SQLSMALLINT
*pcbErrorMsg
);
81 SQLRETURN SQL_API
SQLExecDirectW(
86 SQLRETURN SQL_API
SQLGetConnectAttrW(
88 SQLINTEGER fAttribute
,
90 SQLINTEGER cbValueMax
,
91 SQLINTEGER
*pcbValue
);
93 SQLRETURN SQL_API
SQLGetCursorNameW(
96 SQLSMALLINT cbCursorMax
,
97 SQLSMALLINT
*pcbCursor
);
99 #if (ODBCVER >= 0x0300)
100 SQLRETURN SQL_API
SQLSetDescFieldW(SQLHDESC DescriptorHandle
,
101 SQLSMALLINT RecNumber
,
102 SQLSMALLINT FieldIdentifier
,
104 SQLINTEGER BufferLength
);
108 SQLRETURN SQL_API
SQLGetDescFieldW(
113 SQLINTEGER cbValueMax
,
114 SQLINTEGER
*pcbValue
);
116 SQLRETURN SQL_API
SQLGetDescRecW(
120 SQLSMALLINT cbNameMax
,
121 SQLSMALLINT
*pcbName
,
123 SQLSMALLINT
*pfSubType
,
125 SQLSMALLINT
*pPrecision
,
127 SQLSMALLINT
*pNullable
);
129 SQLRETURN SQL_API
SQLGetDiagFieldW(
130 SQLSMALLINT fHandleType
,
133 SQLSMALLINT fDiagField
,
134 SQLPOINTER rgbDiagInfo
,
135 SQLSMALLINT cbDiagInfoMax
,
136 SQLSMALLINT
*pcbDiagInfo
);
138 SQLRETURN SQL_API
SQLGetDiagRecW(
139 SQLSMALLINT fHandleType
,
142 SQLWCHAR
*szSqlState
,
143 SQLINTEGER
*pfNativeError
,
144 SQLWCHAR
*szErrorMsg
,
145 SQLSMALLINT cbErrorMsgMax
,
146 SQLSMALLINT
*pcbErrorMsg
);
152 SQLRETURN SQL_API
SQLPrepareW(
155 SQLINTEGER cbSqlStr
);
157 SQLRETURN SQL_API
SQLSetConnectAttrW(
159 SQLINTEGER fAttribute
,
163 SQLRETURN SQL_API
SQLSetCursorNameW(
166 SQLSMALLINT cbCursor
);
174 SQLRETURN SQL_API
SQLColumnsW(
176 SQLWCHAR
*szCatalogName
,
177 SQLSMALLINT cbCatalogName
,
178 SQLWCHAR
*szSchemaName
,
179 SQLSMALLINT cbSchemaName
,
180 SQLWCHAR
*szTableName
,
181 SQLSMALLINT cbTableName
,
182 SQLWCHAR
*szColumnName
,
183 SQLSMALLINT cbColumnName
);
185 SQLRETURN SQL_API
SQLGetConnectOptionW(
187 SQLUSMALLINT fOption
,
192 SQLRETURN SQL_API
SQLGetInfoW(
194 SQLUSMALLINT fInfoType
,
195 SQLPOINTER rgbInfoValue
,
196 SQLSMALLINT cbInfoValueMax
,
197 SQLSMALLINT
*pcbInfoValue
);
199 SQLRETURN SQL_API
SQLGetTypeInfoW(
200 SQLHSTMT StatementHandle
,
201 SQLSMALLINT DataType
);
204 SQLRETURN SQL_API
SQLSetConnectOptionW(
206 SQLUSMALLINT fOption
,
210 SQLRETURN SQL_API
SQLSpecialColumnsW(
212 SQLUSMALLINT fColType
,
213 SQLWCHAR
*szCatalogName
,
214 SQLSMALLINT cbCatalogName
,
215 SQLWCHAR
*szSchemaName
,
216 SQLSMALLINT cbSchemaName
,
217 SQLWCHAR
*szTableName
,
218 SQLSMALLINT cbTableName
,
220 SQLUSMALLINT fNullable
);
222 SQLRETURN SQL_API
SQLStatisticsW(
224 SQLWCHAR
*szCatalogName
,
225 SQLSMALLINT cbCatalogName
,
226 SQLWCHAR
*szSchemaName
,
227 SQLSMALLINT cbSchemaName
,
228 SQLWCHAR
*szTableName
,
229 SQLSMALLINT cbTableName
,
230 SQLUSMALLINT fUnique
,
231 SQLUSMALLINT fAccuracy
);
233 SQLRETURN SQL_API
SQLTablesW(
235 SQLWCHAR
*szCatalogName
,
236 SQLSMALLINT cbCatalogName
,
237 SQLWCHAR
*szSchemaName
,
238 SQLSMALLINT cbSchemaName
,
239 SQLWCHAR
*szTableName
,
240 SQLSMALLINT cbTableName
,
241 SQLWCHAR
*szTableType
,
242 SQLSMALLINT cbTableType
);
246 SQLRETURN SQL_API
SQLDataSourcesW(
248 SQLUSMALLINT fDirection
,
250 SQLSMALLINT cbDSNMax
,
252 SQLWCHAR
*szDescription
,
253 SQLSMALLINT cbDescriptionMax
,
254 SQLSMALLINT
*pcbDescription
);
259 SQLRETURN SQL_API
SQLDriverConnectW(
262 SQLWCHAR
*szConnStrIn
,
263 SQLSMALLINT cbConnStrIn
,
264 SQLWCHAR
*szConnStrOut
,
265 SQLSMALLINT cbConnStrOutMax
,
266 SQLSMALLINT
*pcbConnStrOut
,
267 SQLUSMALLINT fDriverCompletion
);
270 SQLRETURN SQL_API
SQLBrowseConnectW(
272 SQLWCHAR
*szConnStrIn
,
273 SQLSMALLINT cbConnStrIn
,
274 SQLWCHAR
*szConnStrOut
,
275 SQLSMALLINT cbConnStrOutMax
,
276 SQLSMALLINT
*pcbConnStrOut
);
278 SQLRETURN SQL_API
SQLColumnPrivilegesW(
280 SQLWCHAR
*szCatalogName
,
281 SQLSMALLINT cbCatalogName
,
282 SQLWCHAR
*szSchemaName
,
283 SQLSMALLINT cbSchemaName
,
284 SQLWCHAR
*szTableName
,
285 SQLSMALLINT cbTableName
,
286 SQLWCHAR
*szColumnName
,
287 SQLSMALLINT cbColumnName
);
289 SQLRETURN SQL_API
SQLGetStmtAttrW(
291 SQLINTEGER fAttribute
,
293 SQLINTEGER cbValueMax
,
294 SQLINTEGER
*pcbValue
);
296 SQLRETURN SQL_API
SQLSetStmtAttrW(
298 SQLINTEGER fAttribute
,
300 SQLINTEGER cbValueMax
);
302 SQLRETURN SQL_API
SQLForeignKeysW(
304 SQLWCHAR
*szPkCatalogName
,
305 SQLSMALLINT cbPkCatalogName
,
306 SQLWCHAR
*szPkSchemaName
,
307 SQLSMALLINT cbPkSchemaName
,
308 SQLWCHAR
*szPkTableName
,
309 SQLSMALLINT cbPkTableName
,
310 SQLWCHAR
*szFkCatalogName
,
311 SQLSMALLINT cbFkCatalogName
,
312 SQLWCHAR
*szFkSchemaName
,
313 SQLSMALLINT cbFkSchemaName
,
314 SQLWCHAR
*szFkTableName
,
315 SQLSMALLINT cbFkTableName
);
318 SQLRETURN SQL_API
SQLNativeSqlW(
320 SQLWCHAR
*szSqlStrIn
,
321 SQLINTEGER cbSqlStrIn
,
323 SQLINTEGER cbSqlStrMax
,
324 SQLINTEGER
*pcbSqlStr
);
327 SQLRETURN SQL_API
SQLPrimaryKeysW(
329 SQLWCHAR
*szCatalogName
,
330 SQLSMALLINT cbCatalogName
,
331 SQLWCHAR
*szSchemaName
,
332 SQLSMALLINT cbSchemaName
,
333 SQLWCHAR
*szTableName
,
334 SQLSMALLINT cbTableName
);
336 SQLRETURN SQL_API
SQLProcedureColumnsW(
338 SQLWCHAR
*szCatalogName
,
339 SQLSMALLINT cbCatalogName
,
340 SQLWCHAR
*szSchemaName
,
341 SQLSMALLINT cbSchemaName
,
342 SQLWCHAR
*szProcName
,
343 SQLSMALLINT cbProcName
,
344 SQLWCHAR
*szColumnName
,
345 SQLSMALLINT cbColumnName
);
347 SQLRETURN SQL_API
SQLProceduresW(
349 SQLWCHAR
*szCatalogName
,
350 SQLSMALLINT cbCatalogName
,
351 SQLWCHAR
*szSchemaName
,
352 SQLSMALLINT cbSchemaName
,
353 SQLWCHAR
*szProcName
,
354 SQLSMALLINT cbProcName
);
357 SQLRETURN SQL_API
SQLTablePrivilegesW(
359 SQLWCHAR
*szCatalogName
,
360 SQLSMALLINT cbCatalogName
,
361 SQLWCHAR
*szSchemaName
,
362 SQLSMALLINT cbSchemaName
,
363 SQLWCHAR
*szTableName
,
364 SQLSMALLINT cbTableName
);
366 SQLRETURN SQL_API
SQLDriversW(
368 SQLUSMALLINT fDirection
,
369 SQLWCHAR
*szDriverDesc
,
370 SQLSMALLINT cbDriverDescMax
,
371 SQLSMALLINT
*pcbDriverDesc
,
372 SQLWCHAR
*szDriverAttributes
,
373 SQLSMALLINT cbDrvrAttrMax
,
374 SQLSMALLINT
*pcbDrvrAttr
);
379 SQLRETURN SQL_API
SQLColAttributeA(
383 SQLPOINTER pCharAttr
,
384 SQLSMALLINT cbCharAttrMax
,
385 SQLSMALLINT
*pcbCharAttr
,
388 SQLRETURN SQL_API
SQLColAttributesA(
391 SQLUSMALLINT fDescType
,
393 SQLSMALLINT cbDescMax
,
394 SQLSMALLINT
*pcbDesc
,
397 SQLRETURN SQL_API
SQLConnectA(
404 SQLSMALLINT cbAuthStr
);
407 SQLRETURN SQL_API
SQLDescribeColA(
411 SQLSMALLINT cbColNameMax
,
412 SQLSMALLINT
*pcbColName
,
413 SQLSMALLINT
*pfSqlType
,
415 SQLSMALLINT
*pibScale
,
416 SQLSMALLINT
*pfNullable
);
419 SQLRETURN SQL_API
SQLErrorA(
424 SQLINTEGER
*pfNativeError
,
426 SQLSMALLINT cbErrorMsgMax
,
427 SQLSMALLINT
*pcbErrorMsg
);
429 SQLRETURN SQL_API
SQLExecDirectA(
432 SQLINTEGER cbSqlStr
);
434 SQLRETURN SQL_API
SQLGetConnectAttrA(
436 SQLINTEGER fAttribute
,
438 SQLINTEGER cbValueMax
,
439 SQLINTEGER
*pcbValue
);
441 SQLRETURN SQL_API
SQLGetCursorNameA(
444 SQLSMALLINT cbCursorMax
,
445 SQLSMALLINT
*pcbCursor
);
447 #if (ODBCVER >= 0x0300)
448 SQLRETURN SQL_API
SQLGetDescFieldA(
453 SQLINTEGER cbValueMax
,
454 SQLINTEGER
*pcbValue
);
456 SQLRETURN SQL_API
SQLGetDescRecA(
460 SQLSMALLINT cbNameMax
,
461 SQLSMALLINT
*pcbName
,
463 SQLSMALLINT
*pfSubType
,
465 SQLSMALLINT
*pPrecision
,
467 SQLSMALLINT
*pNullable
);
469 SQLRETURN SQL_API
SQLGetDiagFieldA(
470 SQLSMALLINT fHandleType
,
473 SQLSMALLINT fDiagField
,
474 SQLPOINTER rgbDiagInfo
,
475 SQLSMALLINT cbDiagInfoMax
,
476 SQLSMALLINT
*pcbDiagInfo
);
478 SQLRETURN SQL_API
SQLGetDiagRecA(
479 SQLSMALLINT fHandleType
,
483 SQLINTEGER
*pfNativeError
,
485 SQLSMALLINT cbErrorMsgMax
,
486 SQLSMALLINT
*pcbErrorMsg
);
489 SQLRETURN SQL_API
SQLGetStmtAttrA(
491 SQLINTEGER fAttribute
,
493 SQLINTEGER cbValueMax
,
494 SQLINTEGER
*pcbValue
);
498 SQLRETURN SQL_API
SQLGetTypeInfoA(
499 SQLHSTMT StatementHandle
,
500 SQLSMALLINT DataTyoe
);
502 SQLRETURN SQL_API
SQLPrepareA(
505 SQLINTEGER cbSqlStr
);
507 SQLRETURN SQL_API
SQLSetConnectAttrA(
509 SQLINTEGER fAttribute
,
513 SQLRETURN SQL_API
SQLSetCursorNameA(
516 SQLSMALLINT cbCursor
);
524 SQLRETURN SQL_API
SQLColumnsA(
526 SQLCHAR
*szCatalogName
,
527 SQLSMALLINT cbCatalogName
,
528 SQLCHAR
*szSchemaName
,
529 SQLSMALLINT cbSchemaName
,
530 SQLCHAR
*szTableName
,
531 SQLSMALLINT cbTableName
,
532 SQLCHAR
*szColumnName
,
533 SQLSMALLINT cbColumnName
);
535 SQLRETURN SQL_API
SQLGetConnectOptionA(
537 SQLUSMALLINT fOption
,
542 SQLRETURN SQL_API
SQLGetInfoA(
544 SQLUSMALLINT fInfoType
,
545 SQLPOINTER rgbInfoValue
,
546 SQLSMALLINT cbInfoValueMax
,
547 SQLSMALLINT
* pcbInfoValue
);
549 SQLRETURN SQL_API
SQLGetStmtOptionA(
551 SQLUSMALLINT fOption
,
554 SQLRETURN SQL_API
SQLSetConnectOptionA(
556 SQLUSMALLINT fOption
,
559 SQLRETURN SQL_API
SQLSetStmtOptionA(
561 SQLUSMALLINT fOption
,
564 SQLRETURN SQL_API
SQLSpecialColumnsA(
566 SQLUSMALLINT fColType
,
567 SQLCHAR
*szCatalogName
,
568 SQLSMALLINT cbCatalogName
,
569 SQLCHAR
*szSchemaName
,
570 SQLSMALLINT cbSchemaName
,
571 SQLCHAR
*szTableName
,
572 SQLSMALLINT cbTableName
,
574 SQLUSMALLINT fNullable
);
576 SQLRETURN SQL_API
SQLStatisticsA(
579 SQLCHAR
*szCatalogName
,
580 SQLSMALLINT cbCatalogName
,
581 SQLCHAR
*szSchemaName
,
582 SQLSMALLINT cbSchemaName
,
583 SQLCHAR
*szTableName
,
584 SQLSMALLINT cbTableName
,
585 SQLUSMALLINT fUnique
,
586 SQLUSMALLINT fAccuracy
);
588 SQLRETURN SQL_API
SQLTablesA(
591 SQLCHAR
*szCatalogName
,
592 SQLSMALLINT cbCatalogName
,
593 SQLCHAR
*szSchemaName
,
594 SQLSMALLINT cbSchemaName
,
595 SQLCHAR
*szTableName
,
596 SQLSMALLINT cbTableName
,
597 SQLCHAR
*szTableType
,
599 SQLSMALLINT cbTableType
);
603 SQLRETURN SQL_API
SQLDataSourcesA(
605 SQLUSMALLINT fDirection
,
607 SQLSMALLINT cbDSNMax
,
609 SQLCHAR
*szDescription
,
610 SQLSMALLINT cbDescriptionMax
,
611 SQLSMALLINT
*pcbDescription
);
616 SQLRETURN SQL_API
SQLDriverConnectA(
619 SQLCHAR
*szConnStrIn
,
620 SQLSMALLINT cbConnStrIn
,
621 SQLCHAR
*szConnStrOut
,
622 SQLSMALLINT cbConnStrOutMax
,
623 SQLSMALLINT
*pcbConnStrOut
,
624 SQLUSMALLINT fDriverCompletion
);
627 SQLRETURN SQL_API
SQLBrowseConnectA(
629 SQLCHAR
*szConnStrIn
,
630 SQLSMALLINT cbConnStrIn
,
631 SQLCHAR
*szConnStrOut
,
632 SQLSMALLINT cbConnStrOutMax
,
633 SQLSMALLINT
*pcbConnStrOut
);
635 SQLRETURN SQL_API
SQLColumnPrivilegesA(
637 SQLCHAR
*szCatalogName
,
638 SQLSMALLINT cbCatalogName
,
639 SQLCHAR
*szSchemaName
,
640 SQLSMALLINT cbSchemaName
,
641 SQLCHAR
*szTableName
,
642 SQLSMALLINT cbTableName
,
643 SQLCHAR
*szColumnName
,
644 SQLSMALLINT cbColumnName
);
646 SQLRETURN SQL_API
SQLDescribeParamA(
649 SQLSMALLINT
*pfSqlType
,
650 SQLUINTEGER
*pcbParamDef
,
651 SQLSMALLINT
*pibScale
,
652 SQLSMALLINT
*pfNullable
);
655 SQLRETURN SQL_API
SQLForeignKeysA(
657 SQLCHAR
*szPkCatalogName
,
658 SQLSMALLINT cbPkCatalogName
,
659 SQLCHAR
*szPkSchemaName
,
660 SQLSMALLINT cbPkSchemaName
,
661 SQLCHAR
*szPkTableName
,
662 SQLSMALLINT cbPkTableName
,
663 SQLCHAR
*szFkCatalogName
,
664 SQLSMALLINT cbFkCatalogName
,
665 SQLCHAR
*szFkSchemaName
,
666 SQLSMALLINT cbFkSchemaName
,
667 SQLCHAR
*szFkTableName
,
668 SQLSMALLINT cbFkTableName
);
671 SQLRETURN SQL_API
SQLNativeSqlA(
674 SQLINTEGER cbSqlStrIn
,
676 SQLINTEGER cbSqlStrMax
,
677 SQLINTEGER
*pcbSqlStr
);
680 SQLRETURN SQL_API
SQLPrimaryKeysA(
682 SQLCHAR
*szCatalogName
,
683 SQLSMALLINT cbCatalogName
,
684 SQLCHAR
*szSchemaName
,
685 SQLSMALLINT cbSchemaName
,
686 SQLCHAR
*szTableName
,
687 SQLSMALLINT cbTableName
);
689 SQLRETURN SQL_API
SQLProcedureColumnsA(
691 SQLCHAR
*szCatalogName
,
692 SQLSMALLINT cbCatalogName
,
693 SQLCHAR
*szSchemaName
,
694 SQLSMALLINT cbSchemaName
,
696 SQLSMALLINT cbProcName
,
697 SQLCHAR
*szColumnName
,
698 SQLSMALLINT cbColumnName
);
700 SQLRETURN SQL_API
SQLProceduresA(
702 SQLCHAR
*szCatalogName
,
703 SQLSMALLINT cbCatalogName
,
704 SQLCHAR
*szSchemaName
,
705 SQLSMALLINT cbSchemaName
,
707 SQLSMALLINT cbProcName
);
710 SQLRETURN SQL_API
SQLTablePrivilegesA(
712 SQLCHAR
*szCatalogName
,
713 SQLSMALLINT cbCatalogName
,
714 SQLCHAR
*szSchemaName
,
715 SQLSMALLINT cbSchemaName
,
716 SQLCHAR
*szTableName
,
717 SQLSMALLINT cbTableName
);
719 SQLRETURN SQL_API
SQLDriversA(
721 SQLUSMALLINT fDirection
,
722 SQLCHAR
*szDriverDesc
,
723 SQLSMALLINT cbDriverDescMax
,
724 SQLSMALLINT
*pcbDriverDesc
,
725 SQLCHAR
*szDriverAttributes
,
726 SQLSMALLINT cbDrvrAttrMax
,
727 SQLSMALLINT
*pcbDrvrAttr
);
733 /*---------------------------------------------*/
734 /* Mapping macros for Unicode */
735 /*---------------------------------------------*/
737 #ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */
740 #define SQLColAttribute SQLColAttributeW
741 #define SQLColAttributes SQLColAttributesW
742 #define SQLConnect SQLConnectW
743 #define SQLDescribeCol SQLDescribeColW
744 #define SQLError SQLErrorW
745 #define SQLExecDirect SQLExecDirectW
746 #define SQLGetConnectAttr SQLGetConnectAttrW
747 #define SQLGetCursorName SQLGetCursorNameW
748 #define SQLGetDescField SQLGetDescFieldW
749 #define SQLGetDescRec SQLGetDescRecW
750 #define SQLGetDiagField SQLGetDiagFieldW
751 #define SQLGetDiagRec SQLGetDiagRecW
752 #define SQLPrepare SQLPrepareW
753 #define SQLSetConnectAttr SQLSetConnectAttrW
754 #define SQLSetCursorName SQLSetCursorNameW
755 #define SQLSetDescField SQLSetDescFieldW
756 #define SQLSetStmtAttr SQLSetStmtAttrW
757 #define SQLGetStmtAttr SQLGetStmtAttrW
758 #define SQLColumns SQLColumnsW
759 #define SQLGetConnectOption SQLGetConnectOptionW
760 #define SQLGetInfo SQLGetInfoW
761 #define SQLGetTypeInfo SQLGetTypeInfoW
762 #define SQLSetConnectOption SQLSetConnectOptionW
763 #define SQLSpecialColumns SQLSpecialColumnsW
764 #define SQLStatistics SQLStatisticsW
765 #define SQLTables SQLTablesW
766 #define SQLDataSources SQLDataSourcesW
767 #define SQLDriverConnect SQLDriverConnectW
768 #define SQLBrowseConnect SQLBrowseConnectW
769 #define SQLColumnPrivileges SQLColumnPrivilegesW
770 #define SQLForeignKeys SQLForeignKeysW
771 #define SQLNativeSql SQLNativeSqlW
772 #define SQLPrimaryKeys SQLPrimaryKeysW
773 #define SQLProcedureColumns SQLProcedureColumnsW
774 #define SQLProcedures SQLProceduresW
775 #define SQLTablePrivileges SQLTablePrivilegesW
776 #define SQLDrivers SQLDriversW
779 #endif /* SQL_NOUNICODEMAP */