windows changes
[csql.git] / src / odbc / odbcCommon.cxx
blob3e7d6aea189a49eb368e79cc8ab560fde71695b7
1 #include "odbcCommon.h"
3 SQLRETURN SQLAllocHandle( SQLSMALLINT hdlType,
4 SQLHANDLE inHdl,
5 SQLHANDLE *outHdl )
7 switch( hdlType )
9 case SQL_HANDLE_ENV:
10 return CSqlOdbcEnv::SQLAllocHandle( inHdl, outHdl );
11 case SQL_HANDLE_DBC:
12 return CSqlOdbcDbc::SQLAllocHandle( inHdl, outHdl );
13 case SQL_HANDLE_STMT:
14 return CSqlOdbcStmt::SQLAllocHandle( inHdl, outHdl );
17 globalError.set( ERROR_OPTRANGE );
18 globalError.printStr( SQL_OV_ODBC3 );
19 return( SQL_ERROR );
22 SQLRETURN SQLFreeHandle(
23 SQLSMALLINT hdlType,
24 SQLHANDLE inHdl)
26 switch( hdlType )
28 case SQL_HANDLE_ENV: return CSqlOdbcEnv::SQLFreeHandle( inHdl );
29 case SQL_HANDLE_DBC: return CSqlOdbcDbc::SQLFreeHandle( inHdl );
30 case SQL_HANDLE_STMT: return CSqlOdbcStmt::SQLFreeHandle( inHdl );
33 globalError.set( ERROR_OPTRANGE );
34 globalError.printStr( SQL_OV_ODBC3 );
35 return( SQL_ERROR );
38 SQLRETURN SQLEndTran(
39 SQLSMALLINT hdlType,
40 SQLHANDLE hdl,
41 SQLSMALLINT compType)
43 if( isValidHandle( hdl, hdlType ) != SQL_SUCCESS )
44 return( SQL_INVALID_HANDLE );
46 switch( hdlType )
48 case SQL_HANDLE_ENV:
49 return ((CSqlOdbcEnv*) hdl)->SQLEndTran( compType );
50 case SQL_HANDLE_DBC:
51 return ((CSqlOdbcDbc*) hdl)->SQLEndTran( compType );
54 globalError.set( ERROR_OPTRANGE );
55 globalError.printStr( SQL_OV_ODBC3 );
56 return( SQL_ERROR );
59 SQLRETURN isValidHandle( SQLHANDLE hdl,
60 SQLSMALLINT hdlType)
62 if( hdlType == SQL_HANDLE_ENV || hdlType == SQL_HANDLE_DBC || hdlType == SQL_HANDLE_STMT )
64 if( hdl != 0 )
65 if( ((CSqlOdbcEnv*) hdl)->handleType_ == hdlType )
66 return( SQL_SUCCESS );
68 globalError.set( ERROR_MEM_MGMNT );
69 globalError.printStr( SQL_OV_ODBC3 );
70 return( SQL_INVALID_HANDLE );
73 SQLRETURN isValidCType( SQLSMALLINT type )
75 switch( type )
77 case SQL_C_CHAR:
78 case SQL_C_SLONG:
79 case SQL_C_ULONG:
80 case SQL_C_LONG:
81 case SQL_C_FLOAT:
82 case SQL_C_DOUBLE:
83 case SQL_C_BIT:
84 case SQL_C_SSHORT:
85 case SQL_C_USHORT:
86 case SQL_C_SHORT:
87 case SQL_C_STINYINT:
88 case SQL_C_UTINYINT:
89 case SQL_C_TINYINT:
90 case SQL_C_SBIGINT:
91 case SQL_C_UBIGINT:
92 case SQL_C_NUMERIC:
93 case SQL_C_DATE:
94 case SQL_C_TIME:
95 case SQL_C_TIMESTAMP:
96 case SQL_C_TYPE_DATE:
97 case SQL_C_TYPE_TIME:
98 case SQL_C_TYPE_TIMESTAMP:
99 case SQL_C_BINARY: break;
100 default: return( SQL_ERROR );
102 return( SQL_SUCCESS );
105 SQLRETURN isValidSQLType( SQLSMALLINT type )
107 switch( type )
109 case SQL_CHAR:
110 case SQL_VARCHAR:
111 case SQL_BIT:
112 case SQL_SMALLINT:
113 case SQL_INTEGER:
114 case SQL_REAL:
115 case SQL_DOUBLE:
116 case SQL_FLOAT:
117 case SQL_TINYINT:
118 case SQL_BIGINT:
119 case SQL_DECIMAL:
120 case SQL_NUMERIC:
121 case SQL_DATE:
122 case SQL_TIME:
123 case SQL_TIMESTAMP:
124 case SQL_TYPE_DATE:
125 case SQL_TYPE_TIME:
126 case SQL_TYPE_TIMESTAMP:
127 case SQL_BINARY:
128 case SQL_VARBINARY: break;
129 default: return( SQL_ERROR );
131 return( SQL_SUCCESS );
134 DataType getCSqlType( SQLSMALLINT type )
136 switch( type )
138 case SQL_C_CHAR:
139 return typeString;
140 case SQL_C_LONG:
141 case SQL_C_SLONG:
142 return typeInt;
143 case SQL_C_ULONG:
144 return typeLong;
145 case SQL_C_FLOAT:
146 return typeFloat;
147 case SQL_C_DOUBLE:
148 return typeDouble;
149 case SQL_C_BIT:
150 return typeUnknown;
151 case SQL_C_SHORT:
152 case SQL_C_SSHORT:
153 case SQL_C_USHORT:
154 return typeShort;
155 case SQL_C_TINYINT:
156 case SQL_C_STINYINT:
157 case SQL_C_UTINYINT:
158 return typeByteInt;
159 case SQL_C_SBIGINT:
160 case SQL_C_UBIGINT:
161 return typeLongLong;
162 case SQL_C_NUMERIC:
163 return typeDecimal;
164 case SQL_C_DATE:
165 case SQL_C_TYPE_DATE:
166 return typeDate;
167 case SQL_C_TIME:
168 case SQL_C_TYPE_TIME:
169 return typeTime;
170 case SQL_C_TIMESTAMP:
171 case SQL_C_TYPE_TIMESTAMP:
172 return typeTimeStamp;
173 break;
174 case SQL_C_BINARY:
175 return typeBinary;
176 default: return( typeUnknown);
180 SQLSMALLINT getSQLType( DataType type )
182 switch(type)
184 case typeShort:
185 return SQL_SMALLINT;
186 case typeInt:
187 case typeLong:
188 return SQL_INTEGER;
189 case typeLongLong:
190 return SQL_BIGINT;
191 case typeByteInt:
192 return SQL_TINYINT;
194 case typeFloat:
195 return SQL_FLOAT;
196 case typeDouble:
197 return SQL_DOUBLE;
198 case typeDecimal:
199 return SQL_NUMERIC;
201 case typeDate:
202 return SQL_DATE;
203 case typeTime:
204 return SQL_TIME;
205 case typeTimeStamp:
206 return SQL_TIMESTAMP;
208 case typeString:
209 return SQL_CHAR;
210 case typeBinary:
211 return SQL_BINARY;
213 // NOT SUPPORTED
214 //case csqlSqlTlongDouble: might be equal typeDecimal
215 // return SQL_REAL;
216 //case csqlSqlTvarString:
217 // return SQL_VARCHAR;
218 //case csqlSqlTvarBinary:
219 // return SQL_BINARY;
220 //case typeBit:
221 // return SQL_BIT;
222 default:
223 return SQL_ERROR;
224 break;
228 SQLCHAR *getSQLTypeName( SQLSMALLINT type )
230 switch( type )
232 case SQL_CHAR:
233 return (SQLCHAR *)"CHAR";
234 case SQL_VARCHAR:
235 return (SQLCHAR *)"VARCHAR";
236 case SQL_BIT:
237 return (SQLCHAR *)"BIT";
238 case SQL_SMALLINT:
239 return (SQLCHAR *)"SMALLINT";
240 case SQL_INTEGER:
241 return (SQLCHAR *)"INTEGER";
242 case SQL_REAL:
243 return (SQLCHAR *)"REAL";
244 case SQL_DECIMAL:
245 case SQL_NUMERIC:
246 return (SQLCHAR *)"NUMERIC";
247 case SQL_DOUBLE:
248 return (SQLCHAR *)"DOUBLE";
249 case SQL_FLOAT:
250 return (SQLCHAR *)"FLOAT";
251 case SQL_TINYINT:
252 return (SQLCHAR *)"TINYINT";
253 case SQL_BIGINT:
254 return (SQLCHAR *)"BIGINT";
255 case SQL_DATE:
256 case SQL_TYPE_DATE:
257 return (SQLCHAR *)"DATE";
258 case SQL_TIME:
259 case SQL_TYPE_TIME:
260 return (SQLCHAR *)"TIME";
261 case SQL_TIMESTAMP:
262 case SQL_TYPE_TIMESTAMP:
263 return (SQLCHAR *)"TIMESTAMP";
264 case SQL_BINARY:
265 return (SQLCHAR *)"BINARY";
266 default:
267 break;
271 void getInputBuffer(void **buffer,SQLSMALLINT type,SQLUINTEGER length)
273 switch(type)
275 case typeShort:
276 *buffer = new short();
277 break;
278 case typeInt:
279 *buffer= new int();
280 break;
281 case typeLong:
282 *buffer= new long();
283 break;
284 case typeLongLong:
285 *buffer = new long long();
286 break;
287 case typeByteInt:
288 *buffer = new signed char();
289 break;
290 /* case csqlSqlTbit:
291 *buffer = new unsigned char ();
292 break;*/
294 case typeFloat:
295 *buffer = new float();
296 break;
297 case typeDouble:
298 *buffer = new double();
299 break;
300 case typeDecimal:
301 // case csqlSqlTlongDouble:
302 // case csqlSqlTnumeric:
303 *buffer = new long double ();
304 break;
306 case typeString:
307 // case csqlSqlTvarString:
308 *buffer = new char [length+1];
309 break;
310 case typeDate:
311 *buffer = new Date();
312 break;
313 case typeTime:
314 *buffer = new Time();
315 break;
316 case typeTimeStamp:
317 *buffer = new TimeStamp();
318 break;
319 case typeBinary:
320 // case csqlSqlTvarBinary:
321 *buffer = new unsigned char [length+1];
322 break;
326 // CSQL TODO - Need to review and finalize.
327 //Copies data from the application onto the destination
328 //Called from SQLExecute
329 //Destination here can be directly the database bound buffer or
330 //it may be ird
331 void copyFromOdbc(AbsSqlStatement *stmt, int paramNo, SQLUINTEGER destLen,void *odbcData,SQLUINTEGER odbcLen,SQLSMALLINT type)
333 //No point in continuing further
334 if(odbcData == NULL)
335 return;
336 switch( type )
338 case typeShort:
339 //*(short*)destData = *(short*)odbcData;
340 stmt->setShortParam(paramNo, *(short*)odbcData);
341 break;
342 case typeInt:
343 //*(int*)destData = *(int*)odbcData;
344 stmt->setIntParam(paramNo, *(int*)odbcData);
345 break;
346 case typeLong:
347 //*(long*)destData = *(long*)odbcData;
348 stmt->setLongParam(paramNo, *(long*)odbcData);
349 break;
350 case typeLongLong:
351 //*(long long*)destData = *(long long*)odbcData;
352 stmt->setLongLongParam(paramNo, *(long long *)odbcData);
353 break;
354 case typeByteInt: {
355 //*(char*)destData = *(char*)odbcData;
356 ByteInt bt(*(char*)odbcData);
357 stmt->setByteIntParam(paramNo, bt);
358 break;
360 /* case csqlSqlTbit:
361 *(unsigned char*)destData = *(unsigned char*)odbcData;
362 break;*/
364 case typeFloat:
365 //*(float*)destData = *(float*)odbcData;
366 stmt->setFloatParam(paramNo, *(float*)odbcData);
367 break;
369 case typeDouble:
370 //*(double*)destData = *(double*)odbcData;
371 stmt->setDoubleParam(paramNo, *(double*)odbcData);
372 break;
374 // case csqlSqlTlongDouble:
375 // case csqlSqlTnumeric:
376 case typeDecimal:
377 //*(long double*)destData = *(long double*)odbcData;
378 // TODO
379 break;
381 case typeString:
382 stmt->setStringParam(paramNo, (char*) odbcData);
383 /*if(odbcLen < destLen)
385 strcpy( (char*)destData, (char*)odbcData);
386 *((char*)destData+odbcLen)='\0';
388 else
390 strncpy((char*)destData,(char*)odbcData,(destLen-1));
391 *((char*)destData+destLen)='\0';
394 break;
395 case typeDate: {
396 Date dt;
397 dt.set((*(SQL_DATE_STRUCT *)odbcData).year,
398 (*(SQL_DATE_STRUCT *)odbcData).month,
399 (*(SQL_DATE_STRUCT *)odbcData).day);
400 stmt->setDateParam(paramNo, dt);
401 break;
403 case typeTime: {
404 Time tm;
405 tm.set((*(SQL_TIME_STRUCT *)odbcData).hour,
406 (*(SQL_TIME_STRUCT *)odbcData).minute,
407 (*(SQL_TIME_STRUCT *)odbcData).second);
408 stmt->setTimeParam(paramNo, tm);
409 break;
411 case typeTimeStamp: {
412 TimeStamp ts;
413 ts.setDate((*(SQL_TIMESTAMP_STRUCT *)odbcData).year,
414 (*(SQL_TIMESTAMP_STRUCT *)odbcData).month,
415 (*(SQL_TIMESTAMP_STRUCT *)odbcData).day);
416 ts.setTime((*(SQL_TIMESTAMP_STRUCT*)odbcData).hour,
417 (*(SQL_TIMESTAMP_STRUCT *)odbcData).minute,
418 (*(SQL_TIMESTAMP_STRUCT *)odbcData).second);
419 stmt->setTimeStampParam(paramNo, ts);
420 break;
426 void convertFromOdbc(DataType srcType, void *src, DataType destType, void *dest,int length, TDBInfo tdbname)
428 switch ((DataType) destType )
430 case typeInt: AllDataType::convertToInt(dest, src, srcType); break;
431 case typeLong: AllDataType::convertToLong(dest, src, srcType); break;
432 case typeLongLong: AllDataType::convertToLongLong(dest, src, srcType); break;
433 case typeShort: AllDataType::convertToShort(dest, src, srcType); break;
434 case typeByteInt: AllDataType::convertToByteInt(dest, src, srcType); break;
436 case typeFloat: AllDataType::convertToFloat(dest, src, srcType); break;
437 case typeDouble: AllDataType::convertToDouble(dest, src, srcType); break;
439 //TODO
440 case typeDecimal: AllDataType::convertToDouble(dest, src, srcType); break;
442 case typeString: convertToStringFromOdbc(dest, src, srcType); break;
443 case typeBinary: AllDataType::convertToBinary(dest, src, srcType,length); break;
444 case typeDate: AllDataType::convertToDate(dest, src, srcType); break;
445 case typeTime: AllDataType::convertToTime(dest, src, srcType); break;
446 case typeTimeStamp: AllDataType::convertToTimeStamp(dest, src, srcType); break;
447 default: return;
450 void convertToStringFromOdbc(void *dest,void*src,DataType srcType,int length,TDBInfo tdbname )
452 switch(srcType)
454 case typeInt:
456 //sprintf ((char *)dest, "%d", *(int *)src);
457 Util::itoa(*(int*)src, (char*)dest);
458 break;
460 case typeLong:
462 sprintf ((char *)dest, "%ld", *(long *)src);
463 break;
465 case typeLongLong:
467 sprintf ((char *)dest, "%lld", *(long long *)src);
468 break;
470 case typeShort:
472 sprintf ((char *)dest, "%hd", *(short *)src);
473 break;
475 case typeByteInt:
477 sprintf ((char *)dest, "%hhd", *(char *)src);
478 break;
481 case typeFloat:
483 sprintf ((char *)dest, "%f", *(float *)src);
484 break;
486 case typeDouble:
488 sprintf ((char *) dest, "%lf", *(double *)src);
489 break;
491 case typeString:
493 strcpy((char*)dest, (char*)src);
494 break;
496 case typeDate:
498 Date dt;
499 dt.set((*(SQL_DATE_STRUCT *)src).year,
500 (*(SQL_DATE_STRUCT *)src).month,
501 (*(SQL_DATE_STRUCT *)src).day);
502 sprintf((char*) dest, "%d/%d/%d", dt.year(),dt.month(), dt.dayOfMonth());
503 break;
505 case typeTime:
507 Time tm;
508 tm.set((*(SQL_TIME_STRUCT *)src).hour,
509 (*(SQL_TIME_STRUCT *)src).minute,
510 (*(SQL_TIME_STRUCT *)src).second);
511 sprintf((char*)dest,"%d:%d:%d.%d", tm.hours(), tm.minutes(), tm.seconds(), 0);
512 break;
514 case typeTimeStamp:
516 TimeStamp ts;
517 ts.setDate((*(SQL_TIMESTAMP_STRUCT *)src).year,
518 (*(SQL_TIMESTAMP_STRUCT *)src).month,
519 (*(SQL_TIMESTAMP_STRUCT *)src).day);
520 ts.setTime((*(SQL_TIMESTAMP_STRUCT*)src).hour,
521 (*(SQL_TIMESTAMP_STRUCT *)src).minute,
522 (*(SQL_TIMESTAMP_STRUCT *)src).second);
523 sprintf((char*)dest, "%d/%d/%d %d:%d:%d.%d", ts.year(),ts.month(), ts.dayOfMonth(), ts.hours(),ts.minutes(), ts.seconds(), 0 );
524 break;
526 case typeBinary:
528 unsigned char *c = (unsigned char *) src;
529 unsigned char *str = (unsigned char *) dest;
530 unsigned char p = 0;
531 int i = 0;
532 while (i < length) {
533 p = *c >> 4;
534 if (p < 10) sprintf ((char *)str++, "%c", '0' + p);
535 else sprintf((char *)str++, "%c", 'A' + p - 10);
536 p = *c & 0xF;
537 if (p < 10) sprintf ((char *)str++, "%c", '0' + p);
538 else sprintf((char *)str++, "%c", 'A' + p - 10);
539 i++; c++;
541 break;
544 default: ((char*)dest)[0] = '\0';
549 //Copies data from the database onto the application buffer
550 //Called from SQLFetch
551 //Destination here can be the actual application buffer or
552 //it may be ipd_
553 SQLINTEGER copyToOdbc(void *odbcData,SQLUINTEGER odbcLen,void *sourceData,SQLUINTEGER sourceLen,SQLSMALLINT type, SQLSMALLINT apptype)
555 SQLINTEGER ind;
556 if(odbcData == NULL || sourceData == NULL)
557 return -1;
558 if( apptype == typeString && type != apptype){
559 AllDataType::convertToString(odbcData , sourceData,(DataType) type);
560 if(sourceLen < odbcLen) return sourceLen;
561 else return odbcLen;
563 switch( type )
565 case typeShort:
566 *(short*)odbcData = *(short*)sourceData;
567 break;
569 case typeInt:
570 *(int*)odbcData = *(int*)sourceData;
571 break;
573 case typeLong:
574 *(long*)odbcData = *(long*)sourceData;
575 break;
577 case typeLongLong:
578 *(long long*)odbcData = *(long long*)sourceData;
579 break;
581 case typeByteInt:
582 *(char*)odbcData = *(char*)sourceData;
583 break;
585 // case csqlSqlTbit:
586 // CSqlOdbcError::printDbg("copyToOdbc");
587 // *(unsigned char*)odbcData = *(unsigned char*)sourceData;
588 // break;
590 case typeFloat:
591 *(float*)odbcData = *(float*)sourceData;
592 break;
593 case typeDouble:
594 *(double*)odbcData = *(double*)sourceData;
595 break;
596 case typeDecimal:
598 // case csqlSqlTlongDouble:
599 // case csqlSqlTnumeric:
600 *(long double*)odbcData = *(long double*)sourceData;
601 break;
602 case typeString:
603 // case csqlSqlTvarString:
604 if(sourceLen < odbcLen)
606 strcpy((char*)odbcData,(char*)sourceData);
607 ind=strlen((char*)odbcData)+1;
609 else
611 strncpy((char*)odbcData,(char*)sourceData ,odbcLen);
612 ind=odbcLen;
614 *((char *)odbcData+ind-1)='\0';
615 break;
616 case typeDate:
617 (*(SQL_DATE_STRUCT *)odbcData).year = (*(Date *)sourceData).year();
618 (*(SQL_DATE_STRUCT *)odbcData).month= (*(Date *)sourceData).month();
619 (*(SQL_DATE_STRUCT *)odbcData).day = (*(Date *)sourceData).dayOfMonth();
620 break;
621 case typeTime:
622 (*(SQL_TIME_STRUCT *)odbcData).hour = (*(Time *)sourceData).hours();
623 (*(SQL_TIME_STRUCT *)odbcData).minute= (*(Time *)sourceData).minutes();
624 (*(SQL_TIME_STRUCT *)odbcData).second = (*(Time *)sourceData).seconds();
625 break;
626 case typeTimeStamp:
627 (*(SQL_TIMESTAMP_STRUCT *)odbcData).year= (*(TimeStamp *)sourceData).year();
628 (*(SQL_TIMESTAMP_STRUCT *)odbcData).month= (*(TimeStamp *)sourceData).month();
629 (*(SQL_TIMESTAMP_STRUCT *)odbcData).day= (*(TimeStamp *)sourceData).dayOfMonth();
630 (*(SQL_TIMESTAMP_STRUCT *)odbcData).hour = (*(TimeStamp *)sourceData).hours();
631 (*(SQL_TIMESTAMP_STRUCT *)odbcData).minute= (*(TimeStamp *)sourceData).minutes();
632 (*(SQL_TIMESTAMP_STRUCT *)odbcData).second = (*(TimeStamp *)sourceData).seconds();
633 break;
634 case typeBinary:
635 // case csqlSqlTvarBinary:
636 // CSqlOdbcError::printDbg("copyToOdbc");
637 // memset((unsigned char*)odbcData,0,odbcLen);
638 if(sourceLen < odbcLen)
640 memcpy( (unsigned char*)odbcData , (unsigned char*)sourceData,sourceLen);
641 ind=sourceLen;
643 else
645 memcpy( (unsigned char*)odbcData , (unsigned char*)sourceData,odbcLen);
646 ind=odbcLen;
648 break;
650 return ind;
652 bool isFunctionSupports(SQLUSMALLINT type)
654 switch(type)
656 case SQL_API_SQLALLOCHANDLE:
658 return true;
660 case SQL_API_SQLGETDESCFIELD:
662 return false;
664 case SQL_API_SQLBINDCOL:
666 return true;
668 case SQL_API_SQLGETDESCREC:
670 return false;
672 case SQL_API_SQLCANCEL:
674 return false;
676 case SQL_API_SQLGETDIAGFIELD:
678 return false;
680 case SQL_API_SQLCLOSECURSOR:
682 return true;
684 case SQL_API_SQLGETDIAGREC:
686 return true;
688 case SQL_API_SQLCOLATTRIBUTE:
690 return true;
692 case SQL_API_SQLGETENVATTR:
694 return false;
696 case SQL_API_SQLCONNECT:
698 return true;
700 case SQL_API_SQLGETFUNCTIONS:
702 return true;
704 case SQL_API_SQLCOPYDESC:
706 return false;
708 case SQL_API_SQLGETINFO:
710 return true;
712 case SQL_API_SQLDATASOURCES:
714 return false;
716 case SQL_API_SQLGETSTMTATTR:
718 return true;
720 case SQL_API_SQLDESCRIBECOL:
722 return true;
724 case SQL_API_SQLGETTYPEINFO:
726 return true;
728 case SQL_API_SQLDISCONNECT:
730 return true;
732 case SQL_API_SQLNUMRESULTCOLS:
734 return true;
736 case SQL_API_SQLDRIVERS:
738 return false;
740 case SQL_API_SQLPARAMDATA:
742 return false;
744 case SQL_API_SQLENDTRAN:
746 return true;
748 case SQL_API_SQLPREPARE:
750 return true;
752 case SQL_API_SQLEXECDIRECT:
754 return true;
756 case SQL_API_SQLPUTDATA:
758 return false;
760 case SQL_API_SQLEXECUTE:
762 return true;
764 case SQL_API_SQLROWCOUNT:
766 return true;
768 case SQL_API_SQLFETCH:
770 return true;
772 case SQL_API_SQLSETCONNECTATTR:
774 return true;
776 case SQL_API_SQLFETCHSCROLL:
778 return false;
780 case SQL_API_SQLSETCURSORNAME:
782 return false;
784 case SQL_API_SQLFREEHANDLE:
786 return true;
788 case SQL_API_SQLSETDESCFIELD:
790 return false;
792 case SQL_API_SQLFREESTMT:
794 return true;
796 case SQL_API_SQLSETDESCREC:
798 return false;
800 case SQL_API_SQLGETCONNECTATTR:
802 return true;
804 case SQL_API_SQLSETENVATTR:
806 return true;
808 case SQL_API_SQLGETCURSORNAME:
810 return false;
812 case SQL_API_SQLSETSTMTATTR:
814 return true;
816 case SQL_API_SQLGETDATA:
818 return true;
820 case SQL_API_SQLCOLUMNS:
822 return true;
824 case SQL_API_SQLSTATISTICS:
826 return true;
828 case SQL_API_SQLSPECIALCOLUMNS:
830 return false;
832 case SQL_API_SQLTABLES:
834 return true;
836 case SQL_API_SQLBINDPARAMETER:
838 return true;
840 case SQL_API_SQLNATIVESQL:
842 return false;
844 case SQL_API_SQLBROWSECONNECT:
846 return false;
848 case SQL_API_SQLNUMPARAMS:
850 return true;
852 case SQL_API_SQLPRIMARYKEYS:
854 return true;
856 case SQL_API_SQLCOLUMNPRIVILEGES:
858 return false;
860 case SQL_API_SQLPROCEDURECOLUMNS:
862 return false;
864 case SQL_API_SQLDESCRIBEPARAM:
866 return true;
868 case SQL_API_SQLPROCEDURES:
870 return false;
872 case SQL_API_SQLDRIVERCONNECT:
874 return true;
876 case SQL_API_SQLSETPOS:
878 return false;
880 case SQL_API_SQLFOREIGNKEYS:
882 return true;
884 case SQL_API_SQLTABLEPRIVILEGES:
886 return false;
888 case SQL_API_SQLMORERESULTS:
890 return false;
892 default :
893 return false;