1 /**************************************************
4 * These should be consistent with the MS version.
6 **************************************************/
14 #define SQL_WCHAR (-8)
15 #define SQL_WVARCHAR (-9)
16 #define SQL_WLONGVARCHAR (-10)
17 #define SQL_C_WCHAR SQL_WCHAR
20 #define SQL_C_TCHAR SQL_C_WCHAR
22 #define SQL_C_TCHAR SQL_C_CHAR
25 #define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */
27 /* UNICODE versions */
29 SQLRETURN SQL_API
SQLColAttributeW(
34 SQLSMALLINT cbCharAttrMax
,
35 SQLSMALLINT
*pcbCharAttr
,
38 SQLRETURN SQL_API
SQLColAttributesW(
41 SQLUSMALLINT fDescType
,
43 SQLSMALLINT cbDescMax
,
47 SQLRETURN SQL_API
SQLConnectW(
54 SQLSMALLINT cbAuthStr
);
57 SQLRETURN SQL_API
SQLDescribeColW(
61 SQLSMALLINT cbColNameMax
,
62 SQLSMALLINT
*pcbColName
,
63 SQLSMALLINT
*pfSqlType
,
65 SQLSMALLINT
*pibScale
,
66 SQLSMALLINT
*pfNullable
);
69 SQLRETURN SQL_API
SQLErrorW(
74 SQLINTEGER
*pfNativeError
,
76 SQLSMALLINT cbErrorMsgMax
,
77 SQLSMALLINT
*pcbErrorMsg
);
79 SQLRETURN SQL_API
SQLExecDirectW(
84 SQLRETURN SQL_API
SQLGetConnectAttrW(
86 SQLINTEGER fAttribute
,
88 SQLINTEGER cbValueMax
,
89 SQLINTEGER
*pcbValue
);
91 SQLRETURN SQL_API
SQLGetCursorNameW(
94 SQLSMALLINT cbCursorMax
,
95 SQLSMALLINT
*pcbCursor
);
97 #if (ODBCVER >= 0x0300)
98 SQLRETURN SQL_API
SQLSetDescFieldW(SQLHDESC DescriptorHandle
,
99 SQLSMALLINT RecNumber
,
100 SQLSMALLINT FieldIdentifier
,
102 SQLINTEGER BufferLength
);
106 SQLRETURN SQL_API
SQLGetDescFieldW(
111 SQLINTEGER cbValueMax
,
112 SQLINTEGER
*pcbValue
);
114 SQLRETURN SQL_API
SQLGetDescRecW(
118 SQLSMALLINT cbNameMax
,
119 SQLSMALLINT
*pcbName
,
121 SQLSMALLINT
*pfSubType
,
123 SQLSMALLINT
*pPrecision
,
125 SQLSMALLINT
*pNullable
);
127 SQLRETURN SQL_API
SQLGetDiagFieldW(
128 SQLSMALLINT fHandleType
,
131 SQLSMALLINT fDiagField
,
132 SQLPOINTER rgbDiagInfo
,
133 SQLSMALLINT cbDiagInfoMax
,
134 SQLSMALLINT
*pcbDiagInfo
);
136 SQLRETURN SQL_API
SQLGetDiagRecW(
137 SQLSMALLINT fHandleType
,
140 SQLWCHAR
*szSqlState
,
141 SQLINTEGER
*pfNativeError
,
142 SQLWCHAR
*szErrorMsg
,
143 SQLSMALLINT cbErrorMsgMax
,
144 SQLSMALLINT
*pcbErrorMsg
);
150 SQLRETURN SQL_API
SQLPrepareW(
153 SQLINTEGER cbSqlStr
);
155 SQLRETURN SQL_API
SQLSetConnectAttrW(
157 SQLINTEGER fAttribute
,
161 SQLRETURN SQL_API
SQLSetCursorNameW(
164 SQLSMALLINT cbCursor
);
172 SQLRETURN SQL_API
SQLColumnsW(
174 SQLWCHAR
*szCatalogName
,
175 SQLSMALLINT cbCatalogName
,
176 SQLWCHAR
*szSchemaName
,
177 SQLSMALLINT cbSchemaName
,
178 SQLWCHAR
*szTableName
,
179 SQLSMALLINT cbTableName
,
180 SQLWCHAR
*szColumnName
,
181 SQLSMALLINT cbColumnName
);
183 SQLRETURN SQL_API
SQLGetConnectOptionW(
185 SQLUSMALLINT fOption
,
190 SQLRETURN SQL_API
SQLGetInfoW(
192 SQLUSMALLINT fInfoType
,
193 SQLPOINTER rgbInfoValue
,
194 SQLSMALLINT cbInfoValueMax
,
195 SQLSMALLINT
*pcbInfoValue
);
197 SQLRETURN SQL_API
SQLGetTypeInfoW(
198 SQLHSTMT StatementHandle
,
199 SQLSMALLINT DataType
);
202 SQLRETURN SQL_API
SQLSetConnectOptionW(
204 SQLUSMALLINT fOption
,
208 SQLRETURN SQL_API
SQLSpecialColumnsW(
210 SQLUSMALLINT fColType
,
211 SQLWCHAR
*szCatalogName
,
212 SQLSMALLINT cbCatalogName
,
213 SQLWCHAR
*szSchemaName
,
214 SQLSMALLINT cbSchemaName
,
215 SQLWCHAR
*szTableName
,
216 SQLSMALLINT cbTableName
,
218 SQLUSMALLINT fNullable
);
220 SQLRETURN SQL_API
SQLStatisticsW(
222 SQLWCHAR
*szCatalogName
,
223 SQLSMALLINT cbCatalogName
,
224 SQLWCHAR
*szSchemaName
,
225 SQLSMALLINT cbSchemaName
,
226 SQLWCHAR
*szTableName
,
227 SQLSMALLINT cbTableName
,
228 SQLUSMALLINT fUnique
,
229 SQLUSMALLINT fAccuracy
);
231 SQLRETURN SQL_API
SQLTablesW(
233 SQLWCHAR
*szCatalogName
,
234 SQLSMALLINT cbCatalogName
,
235 SQLWCHAR
*szSchemaName
,
236 SQLSMALLINT cbSchemaName
,
237 SQLWCHAR
*szTableName
,
238 SQLSMALLINT cbTableName
,
239 SQLWCHAR
*szTableType
,
240 SQLSMALLINT cbTableType
);
244 SQLRETURN SQL_API
SQLDataSourcesW(
246 SQLUSMALLINT fDirection
,
248 SQLSMALLINT cbDSNMax
,
250 SQLWCHAR
*szDescription
,
251 SQLSMALLINT cbDescriptionMax
,
252 SQLSMALLINT
*pcbDescription
);
257 SQLRETURN SQL_API
SQLDriverConnectW(
260 SQLWCHAR
*szConnStrIn
,
261 SQLSMALLINT cbConnStrIn
,
262 SQLWCHAR
*szConnStrOut
,
263 SQLSMALLINT cbConnStrOutMax
,
264 SQLSMALLINT
*pcbConnStrOut
,
265 SQLUSMALLINT fDriverCompletion
);
268 SQLRETURN SQL_API
SQLBrowseConnectW(
270 SQLWCHAR
*szConnStrIn
,
271 SQLSMALLINT cbConnStrIn
,
272 SQLWCHAR
*szConnStrOut
,
273 SQLSMALLINT cbConnStrOutMax
,
274 SQLSMALLINT
*pcbConnStrOut
);
276 SQLRETURN SQL_API
SQLColumnPrivilegesW(
278 SQLWCHAR
*szCatalogName
,
279 SQLSMALLINT cbCatalogName
,
280 SQLWCHAR
*szSchemaName
,
281 SQLSMALLINT cbSchemaName
,
282 SQLWCHAR
*szTableName
,
283 SQLSMALLINT cbTableName
,
284 SQLWCHAR
*szColumnName
,
285 SQLSMALLINT cbColumnName
);
287 SQLRETURN SQL_API
SQLGetStmtAttrW(
289 SQLINTEGER fAttribute
,
291 SQLINTEGER cbValueMax
,
292 SQLINTEGER
*pcbValue
);
294 SQLRETURN SQL_API
SQLSetStmtAttrW(
296 SQLINTEGER fAttribute
,
298 SQLINTEGER cbValueMax
);
300 SQLRETURN SQL_API
SQLForeignKeysW(
302 SQLWCHAR
*szPkCatalogName
,
303 SQLSMALLINT cbPkCatalogName
,
304 SQLWCHAR
*szPkSchemaName
,
305 SQLSMALLINT cbPkSchemaName
,
306 SQLWCHAR
*szPkTableName
,
307 SQLSMALLINT cbPkTableName
,
308 SQLWCHAR
*szFkCatalogName
,
309 SQLSMALLINT cbFkCatalogName
,
310 SQLWCHAR
*szFkSchemaName
,
311 SQLSMALLINT cbFkSchemaName
,
312 SQLWCHAR
*szFkTableName
,
313 SQLSMALLINT cbFkTableName
);
316 SQLRETURN SQL_API
SQLNativeSqlW(
318 SQLWCHAR
*szSqlStrIn
,
319 SQLINTEGER cbSqlStrIn
,
321 SQLINTEGER cbSqlStrMax
,
322 SQLINTEGER
*pcbSqlStr
);
325 SQLRETURN SQL_API
SQLPrimaryKeysW(
327 SQLWCHAR
*szCatalogName
,
328 SQLSMALLINT cbCatalogName
,
329 SQLWCHAR
*szSchemaName
,
330 SQLSMALLINT cbSchemaName
,
331 SQLWCHAR
*szTableName
,
332 SQLSMALLINT cbTableName
);
334 SQLRETURN SQL_API
SQLProcedureColumnsW(
336 SQLWCHAR
*szCatalogName
,
337 SQLSMALLINT cbCatalogName
,
338 SQLWCHAR
*szSchemaName
,
339 SQLSMALLINT cbSchemaName
,
340 SQLWCHAR
*szProcName
,
341 SQLSMALLINT cbProcName
,
342 SQLWCHAR
*szColumnName
,
343 SQLSMALLINT cbColumnName
);
345 SQLRETURN SQL_API
SQLProceduresW(
347 SQLWCHAR
*szCatalogName
,
348 SQLSMALLINT cbCatalogName
,
349 SQLWCHAR
*szSchemaName
,
350 SQLSMALLINT cbSchemaName
,
351 SQLWCHAR
*szProcName
,
352 SQLSMALLINT cbProcName
);
355 SQLRETURN SQL_API
SQLTablePrivilegesW(
357 SQLWCHAR
*szCatalogName
,
358 SQLSMALLINT cbCatalogName
,
359 SQLWCHAR
*szSchemaName
,
360 SQLSMALLINT cbSchemaName
,
361 SQLWCHAR
*szTableName
,
362 SQLSMALLINT cbTableName
);
364 SQLRETURN SQL_API
SQLDriversW(
366 SQLUSMALLINT fDirection
,
367 SQLWCHAR
*szDriverDesc
,
368 SQLSMALLINT cbDriverDescMax
,
369 SQLSMALLINT
*pcbDriverDesc
,
370 SQLWCHAR
*szDriverAttributes
,
371 SQLSMALLINT cbDrvrAttrMax
,
372 SQLSMALLINT
*pcbDrvrAttr
);
377 SQLRETURN SQL_API
SQLColAttributeA(
381 SQLPOINTER pCharAttr
,
382 SQLSMALLINT cbCharAttrMax
,
383 SQLSMALLINT
*pcbCharAttr
,
386 SQLRETURN SQL_API
SQLColAttributesA(
389 SQLUSMALLINT fDescType
,
391 SQLSMALLINT cbDescMax
,
392 SQLSMALLINT
*pcbDesc
,
395 SQLRETURN SQL_API
SQLConnectA(
402 SQLSMALLINT cbAuthStr
);
405 SQLRETURN SQL_API
SQLDescribeColA(
409 SQLSMALLINT cbColNameMax
,
410 SQLSMALLINT
*pcbColName
,
411 SQLSMALLINT
*pfSqlType
,
413 SQLSMALLINT
*pibScale
,
414 SQLSMALLINT
*pfNullable
);
417 SQLRETURN SQL_API
SQLErrorA(
422 SQLINTEGER
*pfNativeError
,
424 SQLSMALLINT cbErrorMsgMax
,
425 SQLSMALLINT
*pcbErrorMsg
);
427 SQLRETURN SQL_API
SQLExecDirectA(
430 SQLINTEGER cbSqlStr
);
432 SQLRETURN SQL_API
SQLGetConnectAttrA(
434 SQLINTEGER fAttribute
,
436 SQLINTEGER cbValueMax
,
437 SQLINTEGER
*pcbValue
);
439 SQLRETURN SQL_API
SQLGetCursorNameA(
442 SQLSMALLINT cbCursorMax
,
443 SQLSMALLINT
*pcbCursor
);
445 #if (ODBCVER >= 0x0300)
446 SQLRETURN SQL_API
SQLGetDescFieldA(
451 SQLINTEGER cbValueMax
,
452 SQLINTEGER
*pcbValue
);
454 SQLRETURN SQL_API
SQLGetDescRecA(
458 SQLSMALLINT cbNameMax
,
459 SQLSMALLINT
*pcbName
,
461 SQLSMALLINT
*pfSubType
,
463 SQLSMALLINT
*pPrecision
,
465 SQLSMALLINT
*pNullable
);
467 SQLRETURN SQL_API
SQLGetDiagFieldA(
468 SQLSMALLINT fHandleType
,
471 SQLSMALLINT fDiagField
,
472 SQLPOINTER rgbDiagInfo
,
473 SQLSMALLINT cbDiagInfoMax
,
474 SQLSMALLINT
*pcbDiagInfo
);
476 SQLRETURN SQL_API
SQLGetDiagRecA(
477 SQLSMALLINT fHandleType
,
481 SQLINTEGER
*pfNativeError
,
483 SQLSMALLINT cbErrorMsgMax
,
484 SQLSMALLINT
*pcbErrorMsg
);
487 SQLRETURN SQL_API
SQLGetStmtAttrA(
489 SQLINTEGER fAttribute
,
491 SQLINTEGER cbValueMax
,
492 SQLINTEGER
*pcbValue
);
496 SQLRETURN SQL_API
SQLGetTypeInfoA(
497 SQLHSTMT StatementHandle
,
498 SQLSMALLINT DataTyoe
);
500 SQLRETURN SQL_API
SQLPrepareA(
503 SQLINTEGER cbSqlStr
);
505 SQLRETURN SQL_API
SQLSetConnectAttrA(
507 SQLINTEGER fAttribute
,
511 SQLRETURN SQL_API
SQLSetCursorNameA(
514 SQLSMALLINT cbCursor
);
522 SQLRETURN SQL_API
SQLColumnsA(
524 SQLCHAR
*szCatalogName
,
525 SQLSMALLINT cbCatalogName
,
526 SQLCHAR
*szSchemaName
,
527 SQLSMALLINT cbSchemaName
,
528 SQLCHAR
*szTableName
,
529 SQLSMALLINT cbTableName
,
530 SQLCHAR
*szColumnName
,
531 SQLSMALLINT cbColumnName
);
533 SQLRETURN SQL_API
SQLGetConnectOptionA(
535 SQLUSMALLINT fOption
,
540 SQLRETURN SQL_API
SQLGetInfoA(
542 SQLUSMALLINT fInfoType
,
543 SQLPOINTER rgbInfoValue
,
544 SQLSMALLINT cbInfoValueMax
,
545 SQLSMALLINT
* pcbInfoValue
);
547 SQLRETURN SQL_API
SQLGetStmtOptionA(
549 SQLUSMALLINT fOption
,
552 SQLRETURN SQL_API
SQLSetConnectOptionA(
554 SQLUSMALLINT fOption
,
557 SQLRETURN SQL_API
SQLSetStmtOptionA(
559 SQLUSMALLINT fOption
,
562 SQLRETURN SQL_API
SQLSpecialColumnsA(
564 SQLUSMALLINT fColType
,
565 SQLCHAR
*szCatalogName
,
566 SQLSMALLINT cbCatalogName
,
567 SQLCHAR
*szSchemaName
,
568 SQLSMALLINT cbSchemaName
,
569 SQLCHAR
*szTableName
,
570 SQLSMALLINT cbTableName
,
572 SQLUSMALLINT fNullable
);
574 SQLRETURN SQL_API
SQLStatisticsA(
577 SQLCHAR
*szCatalogName
,
578 SQLSMALLINT cbCatalogName
,
579 SQLCHAR
*szSchemaName
,
580 SQLSMALLINT cbSchemaName
,
581 SQLCHAR
*szTableName
,
582 SQLSMALLINT cbTableName
,
583 SQLUSMALLINT fUnique
,
584 SQLUSMALLINT fAccuracy
);
586 SQLRETURN SQL_API
SQLTablesA(
589 SQLCHAR
*szCatalogName
,
590 SQLSMALLINT cbCatalogName
,
591 SQLCHAR
*szSchemaName
,
592 SQLSMALLINT cbSchemaName
,
593 SQLCHAR
*szTableName
,
594 SQLSMALLINT cbTableName
,
595 SQLCHAR
*szTableType
,
597 SQLSMALLINT cbTableType
);
601 SQLRETURN SQL_API
SQLDataSourcesA(
603 SQLUSMALLINT fDirection
,
605 SQLSMALLINT cbDSNMax
,
607 SQLCHAR
*szDescription
,
608 SQLSMALLINT cbDescriptionMax
,
609 SQLSMALLINT
*pcbDescription
);
614 SQLRETURN SQL_API
SQLDriverConnectA(
617 SQLCHAR
*szConnStrIn
,
618 SQLSMALLINT cbConnStrIn
,
619 SQLCHAR
*szConnStrOut
,
620 SQLSMALLINT cbConnStrOutMax
,
621 SQLSMALLINT
*pcbConnStrOut
,
622 SQLUSMALLINT fDriverCompletion
);
625 SQLRETURN SQL_API
SQLBrowseConnectA(
627 SQLCHAR
*szConnStrIn
,
628 SQLSMALLINT cbConnStrIn
,
629 SQLCHAR
*szConnStrOut
,
630 SQLSMALLINT cbConnStrOutMax
,
631 SQLSMALLINT
*pcbConnStrOut
);
633 SQLRETURN SQL_API
SQLColumnPrivilegesA(
635 SQLCHAR
*szCatalogName
,
636 SQLSMALLINT cbCatalogName
,
637 SQLCHAR
*szSchemaName
,
638 SQLSMALLINT cbSchemaName
,
639 SQLCHAR
*szTableName
,
640 SQLSMALLINT cbTableName
,
641 SQLCHAR
*szColumnName
,
642 SQLSMALLINT cbColumnName
);
644 SQLRETURN SQL_API
SQLDescribeParamA(
647 SQLSMALLINT
*pfSqlType
,
648 SQLUINTEGER
*pcbParamDef
,
649 SQLSMALLINT
*pibScale
,
650 SQLSMALLINT
*pfNullable
);
653 SQLRETURN SQL_API
SQLForeignKeysA(
655 SQLCHAR
*szPkCatalogName
,
656 SQLSMALLINT cbPkCatalogName
,
657 SQLCHAR
*szPkSchemaName
,
658 SQLSMALLINT cbPkSchemaName
,
659 SQLCHAR
*szPkTableName
,
660 SQLSMALLINT cbPkTableName
,
661 SQLCHAR
*szFkCatalogName
,
662 SQLSMALLINT cbFkCatalogName
,
663 SQLCHAR
*szFkSchemaName
,
664 SQLSMALLINT cbFkSchemaName
,
665 SQLCHAR
*szFkTableName
,
666 SQLSMALLINT cbFkTableName
);
669 SQLRETURN SQL_API
SQLNativeSqlA(
672 SQLINTEGER cbSqlStrIn
,
674 SQLINTEGER cbSqlStrMax
,
675 SQLINTEGER
*pcbSqlStr
);
678 SQLRETURN SQL_API
SQLPrimaryKeysA(
680 SQLCHAR
*szCatalogName
,
681 SQLSMALLINT cbCatalogName
,
682 SQLCHAR
*szSchemaName
,
683 SQLSMALLINT cbSchemaName
,
684 SQLCHAR
*szTableName
,
685 SQLSMALLINT cbTableName
);
687 SQLRETURN SQL_API
SQLProcedureColumnsA(
689 SQLCHAR
*szCatalogName
,
690 SQLSMALLINT cbCatalogName
,
691 SQLCHAR
*szSchemaName
,
692 SQLSMALLINT cbSchemaName
,
694 SQLSMALLINT cbProcName
,
695 SQLCHAR
*szColumnName
,
696 SQLSMALLINT cbColumnName
);
698 SQLRETURN SQL_API
SQLProceduresA(
700 SQLCHAR
*szCatalogName
,
701 SQLSMALLINT cbCatalogName
,
702 SQLCHAR
*szSchemaName
,
703 SQLSMALLINT cbSchemaName
,
705 SQLSMALLINT cbProcName
);
708 SQLRETURN SQL_API
SQLTablePrivilegesA(
710 SQLCHAR
*szCatalogName
,
711 SQLSMALLINT cbCatalogName
,
712 SQLCHAR
*szSchemaName
,
713 SQLSMALLINT cbSchemaName
,
714 SQLCHAR
*szTableName
,
715 SQLSMALLINT cbTableName
);
717 SQLRETURN SQL_API
SQLDriversA(
719 SQLUSMALLINT fDirection
,
720 SQLCHAR
*szDriverDesc
,
721 SQLSMALLINT cbDriverDescMax
,
722 SQLSMALLINT
*pcbDriverDesc
,
723 SQLCHAR
*szDriverAttributes
,
724 SQLSMALLINT cbDrvrAttrMax
,
725 SQLSMALLINT
*pcbDrvrAttr
);
731 /*---------------------------------------------*/
732 /* Mapping macros for Unicode */
733 /*---------------------------------------------*/
735 #ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */
738 #define SQLColAttribute SQLColAttributeW
739 #define SQLColAttributes SQLColAttributesW
740 #define SQLConnect SQLConnectW
741 #define SQLDescribeCol SQLDescribeColW
742 #define SQLError SQLErrorW
743 #define SQLExecDirect SQLExecDirectW
744 #define SQLGetConnectAttr SQLGetConnectAttrW
745 #define SQLGetCursorName SQLGetCursorNameW
746 #define SQLGetDescField SQLGetDescFieldW
747 #define SQLGetDescRec SQLGetDescRecW
748 #define SQLGetDiagField SQLGetDiagFieldW
749 #define SQLGetDiagRec SQLGetDiagRecW
750 #define SQLPrepare SQLPrepareW
751 #define SQLSetConnectAttr SQLSetConnectAttrW
752 #define SQLSetCursorName SQLSetCursorNameW
753 #define SQLSetDescField SQLSetDescFieldW
754 #define SQLSetStmtAttr SQLSetStmtAttrW
755 #define SQLGetStmtAttr SQLGetStmtAttrW
756 #define SQLColumns SQLColumnsW
757 #define SQLGetConnectOption SQLGetConnectOptionW
758 #define SQLGetInfo SQLGetInfoW
759 #define SQLGetTypeInfo SQLGetTypeInfoW
760 #define SQLSetConnectOption SQLSetConnectOptionW
761 #define SQLSpecialColumns SQLSpecialColumnsW
762 #define SQLStatistics SQLStatisticsW
763 #define SQLTables SQLTablesW
764 #define SQLDataSources SQLDataSourcesW
765 #define SQLDriverConnect SQLDriverConnectW
766 #define SQLBrowseConnect SQLBrowseConnectW
767 #define SQLColumnPrivileges SQLColumnPrivilegesW
768 #define SQLForeignKeys SQLForeignKeysW
769 #define SQLNativeSql SQLNativeSqlW
770 #define SQLPrimaryKeys SQLPrimaryKeysW
771 #define SQLProcedureColumns SQLProcedureColumnsW
772 #define SQLProcedures SQLProceduresW
773 #define SQLTablePrivileges SQLTablePrivilegesW
774 #define SQLDrivers SQLDriversW
777 #endif /* SQL_NOUNICODEMAP */
784 #include <odbx/sqlext.h>