"%s" /* INIKEEPALIVE TIME/INTERVAL */
ABBR_NUMERIC_AS "=%d;"
INI_OPTIONAL_ERRORS "=%d;"
+ INI_FETCHREFCURSORS "=%d;"
#ifdef _HANDLE_ENLIST_IN_DTC_
INI_XAOPT "=%d" /* XAOPT */
#endif /* _HANDLE_ENLIST_IN_DTC_ */
,makeKeepaliveConnectString(keepaliveStr, sizeof(keepaliveStr), ci, FALSE)
,ci->numeric_as
,ci->optional_errors
+ ,ci->fetch_refcursors
#ifdef _HANDLE_ENLIST_IN_DTC_
,ci->xa_opt
#endif /* _HANDLE_ENLIST_IN_DTC_ */
flag |= BIT_LOWERCASEIDENTIFIER;
if (ci->optional_errors)
flag |= BIT_OPTIONALERRORS;
+ if (ci->fetch_refcursors)
+ flag |= BIT_FETCHREFCURSORS;
if (ci->sslmode[0])
{
ci->use_server_side_prepare = (char)((flag & BIT_USESERVERSIDEPREPARE) != 0);
ci->lower_case_identifier = (char)((flag & BIT_LOWERCASEIDENTIFIER) != 0);
ci->optional_errors = (char)((flag & BIT_OPTIONALERRORS) != 0);
+ ci->fetch_refcursors = (char)((flag & BIT_FETCHREFCURSORS) != 0);
}
BOOL
ci->drivers.bools_as_char = atoi(value);
else if (stricmp(attribute, INI_EXTRASYSTABLEPREFIXES) == 0 || stricmp(attribute, ABBR_EXTRASYSTABLEPREFIXES) == 0)
STRCPY_FIXED(ci->drivers.extra_systable_prefixes, value);
+ else if (stricmp(attribute, INI_FETCHREFCURSORS) == 0 || stricmp(attribute, ABBR_FETCHREFCURSORS) == 0)
+ ci->fetch_refcursors = atoi(value);
else
found = FALSE;
ci->wcs_debug = 1;
}
ci->disable_convert_func = 0;
+ ci->fetch_refcursors = DEFAULT_FETCHREFCURSORS;
#ifdef _HANDLE_ENLIST_IN_DTC_
ci->xa_opt = DEFAULT_XAOPT;
#endif /* _HANDLE_ENLIST_IN_DTC_ */
if (SQLGetPrivateProfileString(DSN, INI_SSLMODE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
STRCPY_FIXED(ci->sslmode, temp);
+ if (SQLGetPrivateProfileString(DSN, INI_FETCHREFCURSORS, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
+ ci->fetch_refcursors = atoi(temp);
+
#ifdef _HANDLE_ENLIST_IN_DTC_
if (SQLGetPrivateProfileString(DSN, INI_XAOPT, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
ci->xa_opt = atoi(temp);
INI_IGNORETIMEOUT,
temp,
ODBC_INI);
+ ITOA_FIXED(temp, ci->fetch_refcursors);
+ SQLWritePrivateProfileString(DSN,
+ INI_FETCHREFCURSORS,
+ temp,
+ ODBC_INI);
#ifdef _HANDLE_ENLIST_IN_DTC_
ITOA_FIXED(temp, ci->xa_opt);
SQLWritePrivateProfileString(DSN, INI_XAOPT, temp, ODBC_INI);
conninfo->batch_size = DEFAULT_BATCH_SIZE;
conninfo->ignore_timeout = DEFAULT_IGNORETIMEOUT;
conninfo->wcs_debug = -1;
+ conninfo->fetch_refcursors = -1;
#ifdef _HANDLE_ENLIST_IN_DTC_
conninfo->xa_opt = -1;
#endif /* _HANDLE_ENLIST_IN_DTC_ */
CORR_VALCPY(keepalive_interval);
CORR_VALCPY(batch_size);
CORR_VALCPY(ignore_timeout);
+ CORR_VALCPY(fetch_refcursors);
#ifdef _HANDLE_ENLIST_IN_DTC_
CORR_VALCPY(xa_opt);
#endif
#define INI_IGNORETIMEOUT "IgnoreTimeout"
#define ABBR_IGNORETIMEOUT "D9"
#define INI_DTCLOG "Dtclog"
+#define INI_FETCHREFCURSORS "FetchRefcursors"
+#define ABBR_FETCHREFCURSORS "DA"
/* "PreferLibpq", abbreviated "D4", used to mean whether to prefer libpq.
* libpq is now required
#define INI_PREFERLIBPQ "PreferLibpq"
#define BIT_USESERVERSIDEPREPARE (1L<<25)
#define BIT_LOWERCASEIDENTIFIER (1L<<26)
#define BIT_OPTIONALERRORS (1L<<27)
+#define BIT_FETCHREFCURSORS (1L<<28)
#define EFFECTIVE_BIT_COUNT 28
#define DEFAULT_OPTIONAL_ERRORS 0
#define DEFAULT_BATCH_SIZE 100
#define DEFAULT_IGNORETIMEOUT 0
+#define DEFAULT_FETCHREFCURSORS 0
#ifdef _HANDLE_ENLIST_IN_DTC_
#define DEFAULT_XAOPT 1
ci->allow_keyset = IsDlgButtonChecked(hdlg, DS_UPDATABLECURSORS);
ci->use_server_side_prepare = IsDlgButtonChecked(hdlg, DS_SERVERSIDEPREPARE);
ci->bytea_as_longvarbinary = IsDlgButtonChecked(hdlg, DS_BYTEAASLONGVARBINARY);
+ ci->fetch_refcursors = IsDlgButtonChecked(hdlg, DS_FETCH_REFCURSORS);
/*ci->lower_case_identifier = IsDlgButtonChecked(hdlg, DS_LOWERCASEIDENTIFIER);*/
/* OID Options */
CheckDlgButton(hdlg, DS_UPDATABLECURSORS, ci->allow_keyset);
CheckDlgButton(hdlg, DS_SERVERSIDEPREPARE, ci->use_server_side_prepare);
CheckDlgButton(hdlg, DS_BYTEAASLONGVARBINARY, ci->bytea_as_longvarbinary);
+ CheckDlgButton(hdlg, DS_FETCH_REFCURSORS, ci->fetch_refcursors);
/*CheckDlgButton(hdlg, DS_LOWERCASEIDENTIFIER, ci->lower_case_identifier);*/
EnableWindow(GetDlgItem(hdlg, DS_FAKEOIDINDEX), atoi(ci->show_oid_column));
signed char numeric_as;
signed char optional_errors;
signed char ignore_timeout;
+ signed char fetch_refcursors;
UInt4 extra_opts;
Int4 keepalive_idle;
Int4 keepalive_interval;
PUSHBUTTON "\93K\97p",IDAPPLY,128,ENDLINE_Y,50,14
CONTROL "bytea\82รฐLO\82ร\82ยต\82ร\88ยต\82ยค",DS_BYTEAASLONGVARBINARY,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,85,87,10
+ CONTROL "\8aerefcursor\82ยฉ\82รง\8c\8b\89ร\82รฐ\8eรฆ\93ยพ\82ยต\82ร\82ยท",DS_FETCH_REFCURSORS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,139,85,140,10
END
#define DTC_GRP_X 10
GROUPBOX "Int8 As",IDC_STATIC,5,97,256,25
CONTROL "default",DS_INT8_AS_DEFAULT,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,12,107,40,10
+ CONTROL "Fetch result from each refcursor",DS_FETCH_REFCURSORS,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,163,84,122,10
CONTROL "bigint",DS_INT8_AS_BIGINT,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,55,107,35,10
CONTROL "numeric",DS_INT8_AS_NUMERIC,"Button",BS_AUTORADIOBUTTON |
#define DS_NUMERIC_AS_LONGVARCHAR 1111
#define DS_BATCH_SIZE 1112
#define DS_IGNORETIMEOUT 1113
+#define DS_FETCH_REFCURSORS 1114
// Next default values for new objects
//
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1114
+#define _APS_NEXT_CONTROL_VALUE 1115
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
{
Int2 io, out;
has_out_para = (CountParameters(self, NULL, &io, &out) > 0);
-/*
- * I'm not sure if the following REFCUR_SUPPORT stuff is valuable
- * or not.
- */
-#ifdef REFCUR_SUPPORT
+if (ci->fetch_refcursors)
+{
-MYLOG(DETAIL_LOG_LEVEL, "!!! numfield=%d field_type=%u\n", QR_NumResultCols(res), QR_get_field_type(res, 0));
+MYLOG(DETAIL_LOG_LEVEL, "!!! numfield=%d field_type=%u\n", QR_NumResultCols(rhold.first), QR_get_field_type(rhold.first, 0));
if (!has_out_para &&
- 0 < QR_NumResultCols(res) &&
- PG_TYPE_REFCURSOR == QR_get_field_type(res, 0))
+ 0 < QR_NumResultCols(rhold.first) &&
+ PG_TYPE_REFCURSOR == QR_get_field_type(rhold.first, 0))
{
char fetch[128];
int stmt_type = self->statement_type;
- STR_TO_NAME(self->cursor_name, QR_get_value_backend_text(res, 0, 0));
- QR_Destructor(res);
+ STR_TO_NAME(self->cursor_name, QR_get_value_backend_text(rhold.first, 0, 0));
+ QR_Destructor(rhold.first);
SC_init_Result(self);
SC_set_fetchcursor(self);
qi.result_in = NULL;
qi.cursor = SC_cursor_name(self);
- qi.cache_size = qi.row_size = ci->drivers.fetch_max;
+ qi.fetch_size = qi.row_size = ci->drivers.fetch_max;
SPRINTF_FIXED(fetch, "fetch " FORMAT_LEN " in \"%s\"", qi.fetch_size, SC_cursor_name(self));
- res = CC_send_query(conn, fetch, &qi, qflag | READ_ONLY_QUERY, SC_get_ancestor(self));
- if (NULL != res)
- SC_set_Result(self, res);
+ rhold.first = CC_send_query(conn, fetch, &qi, qflag | READ_ONLY_QUERY, SC_get_ancestor(self));
+ if (NULL != rhold.first)
+ SC_set_Result(self, rhold.first);
}
-#endif /* REFCUR_SUPPORT */
+}
}
if (has_out_para)
{ /* get the return value of the procedure call */