2 * Description: This module contains routines related to ODBC 3.0
3 * most of their implementations are temporary
4 * and must be rewritten properly.
14 #include "connection.h"
15 #include "statement.h"
16 #include "pgapifunc.h"
18 /* SQLAllocConnect/SQLAllocEnv/SQLAllocStmt -> SQLAllocHandle */
20 SQLAllocHandle(SQLSMALLINT HandleType
,
21 SQLHANDLE InputHandle
, SQLHANDLE
* OutputHandle
)
24 ConnectionClass
*conn
;
30 ret
= PGAPI_AllocEnv(OutputHandle
);
33 ENTER_ENV_CS((EnvironmentClass
*) InputHandle
);
34 ret
= PGAPI_AllocConnect(InputHandle
, OutputHandle
);
35 LEAVE_ENV_CS((EnvironmentClass
*) InputHandle
);
38 ENTER_CONN_CS((ConnectionClass
*) InputHandle
);
39 ret
= PGAPI_AllocStmt(InputHandle
, OutputHandle
);
40 LEAVE_CONN_CS((ConnectionClass
*) InputHandle
);
43 conn
= (ConnectionClass
*) InputHandle
;
45 ret
= PGAPI_AllocDesc(InputHandle
, OutputHandle
);
47 inolog("OutputHandle=%p\n", *OutputHandle
);
56 /* SQLBindParameter/SQLSetParam -> SQLBindParam */
58 SQLBindParam(HSTMT StatementHandle
,
59 SQLUSMALLINT ParameterNumber
, SQLSMALLINT ValueType
,
60 SQLSMALLINT ParameterType
, SQLULEN LengthPrecision
,
61 SQLSMALLINT ParameterScale
, PTR ParameterValue
,
62 SQLLEN
* StrLen_or_Ind
)
65 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
66 int BufferLength
= 512; /* Is it OK ? */
71 StartRollbackState(stmt
);
73 PGAPI_BindParameter(StatementHandle
, ParameterNumber
,
74 SQL_PARAM_INPUT
, ValueType
, ParameterType
,
75 LengthPrecision
, ParameterScale
,
76 ParameterValue
, BufferLength
,
78 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
84 RETCODE SQL_API
SQLCloseCursor(HSTMT StatementHandle
)
86 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
92 StartRollbackState(stmt
);
93 ret
= PGAPI_FreeStmt(StatementHandle
, SQL_CLOSE
);
94 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
99 /* SQLColAttributes -> SQLColAttribute */
101 SQLColAttribute(SQLHSTMT StatementHandle
,
102 SQLUSMALLINT ColumnNumber
,
103 SQLUSMALLINT FieldIdentifier
,
104 SQLPOINTER CharacterAttribute
,
105 SQLSMALLINT BufferLength
, SQLSMALLINT
* StringLength
,
107 SQLLEN
* NumericAttribute
108 #elif defined(WITH_UNIXODBC) || defined(WIN32)
109 SQLPOINTER NumericAttribute
111 SQLLEN
* NumericAttribute
116 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
120 SC_clear_error(stmt
);
121 StartRollbackState(stmt
);
122 ret
= PGAPI_ColAttributes(StatementHandle
, ColumnNumber
,
123 FieldIdentifier
, CharacterAttribute
,
124 BufferLength
, StringLength
,
125 (SQLINTEGER
*)NumericAttribute
);
126 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
133 SQLCopyDesc(SQLHDESC SourceDescHandle
, SQLHDESC TargetDescHandle
)
138 ret
= PGAPI_CopyDesc(SourceDescHandle
, TargetDescHandle
);
142 /* SQLTransact -> SQLEndTran */
144 SQLEndTran(SQLSMALLINT HandleType
, SQLHANDLE Handle
,
145 SQLSMALLINT CompletionType
)
153 ENTER_ENV_CS((EnvironmentClass
*) Handle
);
154 ret
= PGAPI_Transact(Handle
, SQL_NULL_HDBC
, CompletionType
);
155 LEAVE_ENV_CS((EnvironmentClass
*) Handle
);
158 ENTER_CONN_CS((ConnectionClass
*) Handle
);
159 CC_clear_error((ConnectionClass
*) Handle
);
160 ret
= PGAPI_Transact(SQL_NULL_HENV
, Handle
, CompletionType
);
161 LEAVE_CONN_CS((ConnectionClass
*) Handle
);
170 /* SQLExtendedFetch -> SQLFetchScroll */
172 SQLFetchScroll(HSTMT StatementHandle
,
173 SQLSMALLINT FetchOrientation
, SQLLEN FetchOffset
)
175 CSTR func
= "SQLFetchScroll";
176 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
177 RETCODE ret
= SQL_SUCCESS
;
178 IRDFields
*irdopts
= SC_get_IRDF(stmt
);
179 SQLUSMALLINT
*rowStatusArray
= irdopts
->rowStatusArray
;
180 SQLUINTEGER
*pcRow
= irdopts
->rowsFetched
, bkmarkoff
= 0;
183 mylog("%d,%d\n", FetchOrientation
, FetchOffset
);
185 SC_clear_error(stmt
);
186 StartRollbackState(stmt
);
187 if (FetchOrientation
== SQL_FETCH_BOOKMARK
)
189 if (stmt
->options
.bookmark_ptr
)
191 bkmarkoff
= FetchOffset
;
192 FetchOffset
= *((Int4
*) stmt
->options
.bookmark_ptr
);
193 mylog("bookmark=%u FetchOffset = %d\n", FetchOffset
,
197 SC_set_error(stmt
, STMT_SEQUENCE_ERROR
,
198 "Bookmark isn't specifed yet", func
);
202 if (SQL_SUCCESS
== ret
)
204 ARDFields
*opts
= SC_get_ARDF(stmt
);
207 PGAPI_ExtendedFetch(StatementHandle
, FetchOrientation
,
208 FetchOffset
, pcRow
, rowStatusArray
,
209 bkmarkoff
, opts
->size_of_rowset
);
210 stmt
->transition_status
= 6;
212 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
214 if (ret
!= SQL_SUCCESS
)
215 mylog("%s return = %d\n", func
, ret
);
219 /* SQLFree(Connect/Env/Stmt) -> SQLFreeHandle */
220 RETCODE SQL_API
SQLFreeHandle(SQLSMALLINT HandleType
, SQLHANDLE Handle
)
227 ret
= PGAPI_FreeEnv(Handle
);
230 ret
= PGAPI_FreeConnect(Handle
);
232 case SQL_HANDLE_STMT
:
233 ret
= PGAPI_FreeStmt(Handle
, SQL_DROP
);
235 case SQL_HANDLE_DESC
:
236 ret
= PGAPI_FreeDesc(Handle
);
247 SQLGetDescField(SQLHDESC DescriptorHandle
,
248 SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
249 PTR Value
, SQLINTEGER BufferLength
,
250 SQLINTEGER
* StringLength
)
256 PGAPI_GetDescField(DescriptorHandle
, RecNumber
, FieldIdentifier
,
257 Value
, BufferLength
, StringLength
);
263 SQLGetDescRec(SQLHDESC DescriptorHandle
,
264 SQLSMALLINT RecNumber
, SQLCHAR
* Name
,
265 SQLSMALLINT BufferLength
, SQLSMALLINT
* StringLength
,
266 SQLSMALLINT
* Type
, SQLSMALLINT
* SubType
,
267 SQLLEN
* Length
, SQLSMALLINT
* Precision
,
268 SQLSMALLINT
* Scale
, SQLSMALLINT
* Nullable
)
271 mylog("Not implemented!\n");
277 SQLGetDiagField(SQLSMALLINT HandleType
, SQLHANDLE Handle
,
278 SQLSMALLINT RecNumber
, SQLSMALLINT DiagIdentifier
,
279 PTR DiagInfo
, SQLSMALLINT BufferLength
,
280 SQLSMALLINT
* StringLength
)
285 mylog("Handle=(%u,%p) Rec=%d Id=%d info=(%p,%d)\n",
286 HandleType
, Handle
, RecNumber
, DiagIdentifier
, DiagInfo
,
289 PGAPI_GetDiagField(HandleType
, Handle
, RecNumber
,
290 DiagIdentifier
, DiagInfo
, BufferLength
,
295 /* SQLError -> SQLDiagRec */
297 SQLGetDiagRec(SQLSMALLINT HandleType
, SQLHANDLE Handle
,
298 SQLSMALLINT RecNumber
, SQLCHAR
* Sqlstate
,
299 SQLINTEGER
* NativeError
, SQLCHAR
* MessageText
,
300 SQLSMALLINT BufferLength
, SQLSMALLINT
* TextLength
)
305 ret
= PGAPI_GetDiagRec(HandleType
, Handle
, RecNumber
, Sqlstate
,
306 NativeError
, MessageText
, BufferLength
,
313 SQLGetEnvAttr(HENV EnvironmentHandle
,
314 SQLINTEGER Attribute
, PTR Value
,
315 SQLINTEGER BufferLength
, SQLINTEGER
* StringLength
)
318 EnvironmentClass
*env
= (EnvironmentClass
*) EnvironmentHandle
;
325 case SQL_ATTR_CONNECTION_POOLING
:
326 *((unsigned int *) Value
) =
327 EN_is_pooling(env
) ? SQL_CP_ONE_PER_DRIVER
: SQL_CP_OFF
;
329 case SQL_ATTR_CP_MATCH
:
330 *((unsigned int *) Value
) = SQL_CP_RELAXED_MATCH
;
332 case SQL_ATTR_ODBC_VERSION
:
333 *((unsigned int *) Value
) =
334 EN_is_odbc2(env
) ? SQL_OV_ODBC2
: SQL_OV_ODBC3
;
336 case SQL_ATTR_OUTPUT_NTS
:
337 *((unsigned int *) Value
) = SQL_TRUE
;
340 env
->errornumber
= CONN_INVALID_ARGUMENT_NO
;
347 /* SQLGetConnectOption -> SQLGetconnectAttr */
349 SQLGetConnectAttr(HDBC ConnectionHandle
,
350 SQLINTEGER Attribute
, PTR Value
,
351 SQLINTEGER BufferLength
, SQLINTEGER
* StringLength
)
356 ENTER_CONN_CS((ConnectionClass
*) ConnectionHandle
);
357 CC_clear_error((ConnectionClass
*) ConnectionHandle
);
358 ret
= PGAPI_GetConnectAttr(ConnectionHandle
, Attribute
, Value
,
359 BufferLength
, StringLength
);
360 LEAVE_CONN_CS((ConnectionClass
*) ConnectionHandle
);
364 /* SQLGetStmtOption -> SQLGetStmtAttr */
366 SQLGetStmtAttr(HSTMT StatementHandle
,
367 SQLINTEGER Attribute
, PTR Value
,
368 SQLINTEGER BufferLength
, SQLINTEGER
* StringLength
)
371 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
374 mylog("Handle=%u %d\n", StatementHandle
, Attribute
);
376 SC_clear_error(stmt
);
377 StartRollbackState(stmt
);
378 ret
= PGAPI_GetStmtAttr(StatementHandle
, Attribute
, Value
,
379 BufferLength
, StringLength
);
380 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
385 /* SQLSetConnectOption -> SQLSetConnectAttr */
387 SQLSetConnectAttr(HDBC ConnectionHandle
,
388 SQLINTEGER Attribute
, PTR Value
,
389 SQLINTEGER StringLength
)
393 ConnectionClass
*conn
= (ConnectionClass
*) ConnectionHandle
;
396 CC_clear_error(conn
);
397 ret
= PGAPI_SetConnectAttr(ConnectionHandle
, Attribute
, Value
,
405 SQLSetDescField(SQLHDESC DescriptorHandle
,
406 SQLSMALLINT RecNumber
, SQLSMALLINT FieldIdentifier
,
407 PTR Value
, SQLINTEGER BufferLength
)
412 mylog("h=%p rec=%d field=%d val=%p\n",
413 DescriptorHandle
, RecNumber
, FieldIdentifier
, Value
);
415 PGAPI_SetDescField(DescriptorHandle
, RecNumber
, FieldIdentifier
,
416 Value
, BufferLength
);
422 SQLSetDescRec(SQLHDESC DescriptorHandle
,
423 SQLSMALLINT RecNumber
, SQLSMALLINT Type
,
424 SQLSMALLINT SubType
, SQLLEN Length
,
425 SQLSMALLINT Precision
, SQLSMALLINT Scale
,
426 PTR Data
, SQLLEN
* StringLength
, SQLLEN
* Indicator
)
429 mylog("Not implemented!\n");
435 SQLSetEnvAttr(HENV EnvironmentHandle
,
436 SQLINTEGER Attribute
, PTR Value
, SQLINTEGER StringLength
)
439 EnvironmentClass
*env
= (EnvironmentClass
*) EnvironmentHandle
;
445 case SQL_ATTR_CONNECTION_POOLING
:
446 switch ((ULONG_PTR
) Value
)
449 EN_unset_pooling(env
);
452 #if defined(WIN_MULTITHREAD_SUPPORT) || defined(POSIX_MULTITHREAD_SUPPORT)
453 case SQL_CP_ONE_PER_DRIVER
:
457 #endif /* WIN_MULTITHREAD_SUPPORT */
459 ret
= SQL_SUCCESS_WITH_INFO
;
462 case SQL_ATTR_CP_MATCH
:
463 /* *((unsigned int *) Value) = SQL_CP_RELAXED_MATCH; */
466 case SQL_ATTR_ODBC_VERSION
:
467 if (SQL_OV_ODBC2
== CAST_UPTR(SQLUINTEGER
, Value
))
473 case SQL_ATTR_OUTPUT_NTS
:
474 if (SQL_TRUE
== CAST_UPTR(SQLUINTEGER
, Value
))
477 ret
= SQL_SUCCESS_WITH_INFO
;
481 env
->errornumber
= CONN_INVALID_ARGUMENT_NO
;
484 if (SQL_SUCCESS_WITH_INFO
== ret
)
486 env
->errornumber
= CONN_OPTION_VALUE_CHANGED
;
487 env
->errormsg
= "SetEnv changed to ";
493 /* SQLSet(Param/Scroll/Stmt)Option -> SQLSetStmtAttr */
495 SQLSetStmtAttr(HSTMT StatementHandle
,
496 SQLINTEGER Attribute
, PTR Value
, SQLINTEGER StringLength
)
498 StatementClass
*stmt
= (StatementClass
*) StatementHandle
;
502 mylog("Handle=%p %d,%u\n", StatementHandle
, Attribute
, Value
);
504 SC_clear_error(stmt
);
505 StartRollbackState(stmt
);
507 PGAPI_SetStmtAttr(StatementHandle
, Attribute
, Value
,
509 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);
514 #define SQL_FUNC_ESET(pfExists, uwAPI) \
515 (*(((UWORD*) (pfExists)) + ((uwAPI) >> 4)) \
516 |= (1 << ((uwAPI) & 0x000F)) \
519 PGAPI_GetFunctions30(HDBC hdbc
, SQLUSMALLINT fFunction
,
520 SQLUSMALLINT FAR
* pfExists
)
522 ConnectionClass
*conn
= (ConnectionClass
*) hdbc
;
523 ConnInfo
*ci
= &(conn
->connInfo
);
526 CC_clear_error(conn
);
527 if (fFunction
!= SQL_API_ODBC3_ALL_FUNCTIONS
)
530 sizeof(UWORD
) * SQL_API_ODBC3_ALL_FUNCTIONS_SIZE
);
532 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLALLOCCONNECT); 1 deprecated */
533 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLALLOCENV); 2 deprecated */
534 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLALLOCSTMT); 3 deprecated */
537 * for (i = SQL_API_SQLBINDCOL; i <= 23; i++) SQL_FUNC_ESET(pfExists,
540 SQL_FUNC_ESET(pfExists
, SQL_API_SQLBINDCOL
); /* 4 */
541 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCANCEL
); /* 5 */
542 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCOLATTRIBUTE
); /* 6 */
543 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCONNECT
); /* 7 */
544 SQL_FUNC_ESET(pfExists
, SQL_API_SQLDESCRIBECOL
); /* 8 */
545 SQL_FUNC_ESET(pfExists
, SQL_API_SQLDISCONNECT
); /* 9 */
546 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLERROR); 10 deprecated */
547 SQL_FUNC_ESET(pfExists
, SQL_API_SQLEXECDIRECT
); /* 11 */
548 SQL_FUNC_ESET(pfExists
, SQL_API_SQLEXECUTE
); /* 12 */
549 SQL_FUNC_ESET(pfExists
, SQL_API_SQLFETCH
); /* 13 */
550 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLFREECONNECT); 14 deprecated */
551 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLFREEENV); 15 deprecated */
552 SQL_FUNC_ESET(pfExists
, SQL_API_SQLFREESTMT
); /* 16 */
553 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETCURSORNAME
); /* 17 */
554 SQL_FUNC_ESET(pfExists
, SQL_API_SQLNUMRESULTCOLS
); /* 18 */
555 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPREPARE
); /* 19 */
556 SQL_FUNC_ESET(pfExists
, SQL_API_SQLROWCOUNT
); /* 20 */
557 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETCURSORNAME
); /* 21 */
558 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLSETPARAM); 22 deprecated */
559 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLTRANSACT); 23 deprecated */
562 * for (i = 40; i < SQL_API_SQLEXTENDEDFETCH; i++)
563 * SQL_FUNC_ESET(pfExists, i);
565 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCOLUMNS
); /* 40 */
566 SQL_FUNC_ESET(pfExists
, SQL_API_SQLDRIVERCONNECT
); /* 41 */
567 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLGETCONNECTOPTION); 42 deprecated */
568 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETDATA
); /* 43 */
569 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETFUNCTIONS
); /* 44 */
570 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETINFO
); /* 45 */
571 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLGETSTMTOPTION); 46 deprecated */
572 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETTYPEINFO
); /* 47 */
573 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPARAMDATA
); /* 48 */
574 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPUTDATA
); /* 49 */
576 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLSETCONNECTIONOPTION); 50 deprecated */
577 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLSETSTMTOPTION); 51 deprecated */
578 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSPECIALCOLUMNS
); /* 52 */
579 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSTATISTICS
); /* 53 */
580 SQL_FUNC_ESET(pfExists
, SQL_API_SQLTABLES
); /* 54 */
581 SQL_FUNC_ESET(pfExists
, SQL_API_SQLDATASOURCES
); /* 57 */
582 if (SUPPORT_DESCRIBE_PARAM(ci
))
583 SQL_FUNC_ESET(pfExists
, SQL_API_SQLDESCRIBEPARAM
); /* 58 */
584 SQL_FUNC_ESET(pfExists
, SQL_API_SQLEXTENDEDFETCH
); /* 59 deprecated ? */
587 * for (++i; i < SQL_API_SQLBINDPARAMETER; i++)
588 * SQL_FUNC_ESET(pfExists, i);
590 SQL_FUNC_ESET(pfExists
, SQL_API_SQLFOREIGNKEYS
); /* 60 */
591 SQL_FUNC_ESET(pfExists
, SQL_API_SQLMORERESULTS
); /* 61 */
592 SQL_FUNC_ESET(pfExists
, SQL_API_SQLNATIVESQL
); /* 62 */
593 SQL_FUNC_ESET(pfExists
, SQL_API_SQLNUMPARAMS
); /* 63 */
594 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLPARAMOPTIONS); 64 deprecated */
595 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPRIMARYKEYS
); /* 65 */
596 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPROCEDURECOLUMNS
); /* 66 */
597 SQL_FUNC_ESET(pfExists
, SQL_API_SQLPROCEDURES
); /* 67 */
598 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETPOS
); /* 68 */
599 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLSETSCROLLOPTIONS); 69 deprecated */
600 SQL_FUNC_ESET(pfExists
, SQL_API_SQLTABLEPRIVILEGES
); /* 70 */
601 /* SQL_FUNC_ESET(pfExists, SQL_API_SQLDRIVERS); *//* 71 */
602 SQL_FUNC_ESET(pfExists
, SQL_API_SQLBINDPARAMETER
); /* 72 */
604 SQL_FUNC_ESET(pfExists
, SQL_API_SQLALLOCHANDLE
); /* 1001 */
605 SQL_FUNC_ESET(pfExists
, SQL_API_SQLBINDPARAM
); /* 1002 */
606 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCLOSECURSOR
); /* 1003 */
607 SQL_FUNC_ESET(pfExists
, SQL_API_SQLCOPYDESC
); /* 1004 */
608 SQL_FUNC_ESET(pfExists
, SQL_API_SQLENDTRAN
); /* 1005 */
609 SQL_FUNC_ESET(pfExists
, SQL_API_SQLFREEHANDLE
); /* 1006 */
610 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETCONNECTATTR
); /* 1007 */
611 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETDESCFIELD
); /* 1008 */
612 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETDIAGFIELD
); /* 1010 minimal implementation */
613 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETDIAGREC
); /* 1011 */
614 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETENVATTR
); /* 1012 */
615 SQL_FUNC_ESET(pfExists
, SQL_API_SQLGETSTMTATTR
); /* 1014 */
616 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETCONNECTATTR
); /* 1016 */
617 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETDESCFIELD
); /* 1017 */
618 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETENVATTR
); /* 1019 */
619 SQL_FUNC_ESET(pfExists
, SQL_API_SQLSETSTMTATTR
); /* 1020 */
620 SQL_FUNC_ESET(pfExists
, SQL_API_SQLFETCHSCROLL
); /* 1021 */
621 if (0 != (ALLOW_BULK_OPERATIONS
& ci
->updatable_cursors
))
622 SQL_FUNC_ESET(pfExists
, SQL_API_SQLBULKOPERATIONS
); /* 24 */
627 RETCODE SQL_API
SQLBulkOperations(HSTMT hstmt
, SQLSMALLINT operation
)
630 StatementClass
*stmt
= (StatementClass
*) hstmt
;
634 mylog("Handle=%p %d\n", hstmt
, operation
);
635 SC_clear_error(stmt
);
636 StartRollbackState(stmt
);
637 ret
= PGAPI_BulkOperations(hstmt
, operation
);
638 ret
= DiscardStatementSvp(stmt
, ret
, FALSE
);