pg.ddx.io pgsql-odbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
ODBC + Dynamic cursors 4+ messages / 3 participants [nested] [flat]
* ODBC + Dynamic cursors @ 2003-07-30 20:06 Amanjit Gill <amanjit.gill@gmx.de> 2003-07-31 00:00 ` Re: ODBC + Dynamic cursors Hiroshi Inoue <Inoue@tpf.co.jp> 0 siblings, 1 reply; 4+ messages in thread From: Amanjit Gill @ 2003-07-30 20:06 UTC (permalink / raw) To: pgsql-odbc Hi, I have written a C++ ODBC wrapper that right now runs on Oracle,Access,SQL Server, Sybase. I am right now investigating PostgreSQL which we want to use instead of SQL Server. PostgreSQL Version: 7.33 (Cygwin/Windows XP) using ipc-daemon ODBC Version: 7.03.01.10 OS: Windows XP Pro, SP1 Synopsis: I basically open a connection to a db, create a statement,use a dynamic cursor via SQLSetConnectAttr (SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_DYNAMIC), execute the statement , bind some fields and want to fetch data using SQLFetchScroll (m_hstmt, SQL_FETCH_ABSOLUTE, lPosition). The SQLFetchScroll statement fails with the following message: 'HY106 - the fetch type for PGAPI_ExtendedFetch isn't allowed for ForwardOnly cursor.' Which of course irritates me because I explicitely use SQL_CURSOR_DYNAMIC. I attached the standard windows SQL.log with some mixins of the code I called. It is not the complete log and it is not the PostgreSQL-Driver specific log, which is far too verbose for me. I have enabled the Dynamic cursor checkbox in the driver. Any suggestions? Another question: are positionable updates and deletes (which means SQLSetPos) possible with PostgreSQL at present (as mentioned in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht m/odch12pr_2.asp) ? Thanks for your help Amanjit Gill Software Developer Medical and Bioinformatics UFK (Gynecology and Obstetrics) University Clinic Charite Berlin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24.07.2003 Attachments:^ permalink raw reply [nested|flat] 4+ messages in threadSQL_LOG_MIXED.txt (text/plain, 4.5K) download
ODBC_result = SQLSetConnectAttr(m_hdbc, SQL_ATTR_ACCESS_MODE, (SQLPOINTER)SQL_MODE_READ_WRITE, SQL_IS_INTEGER); CPPAMICIUnit 660-2d8 ENTER SQLSetConnectAttr SQLHDBC 00961758 SQLINTEGER 101 <SQL_ATTR_ACCESS_MODE> SQLPOINTER 0x00000000 SQLINTEGER -6 CPPAMICIUnit 660-2d8 EXIT SQLSetConnectAttr with return code 0 (SQL_SUCCESS) SQLHDBC 00961758 SQLINTEGER 101 <SQL_ATTR_ACCESS_MODE> SQLPOINTER 0x00000000 SQLINTEGER -6 ODBC_result = SQLSetConnectAttr (m_hdbc, SQL_ATTR_ODBC_CURSORS, (void*) SQL_CUR_USE_IF_NEEDED, SQL_LEN_BINARY_ATTR(SQL_CONCUR_VALUES)); CPPAMICIUnit 660-2d8 ENTER SQLSetConnectAttr SQLHDBC 00961758 SQLINTEGER 110 <SQL_ATTR_ODBC_CURSORS> SQLPOINTER 0x00000000 SQLINTEGER -104 CPPAMICIUnit 660-2d8 EXIT SQLSetConnectAttr with return code 0 (SQL_SUCCESS) SQLHDBC 00961758 SQLINTEGER 110 <SQL_ATTR_ODBC_CURSORS> SQLPOINTER 0x00000000 SQLINTEGER -104 ODBC_result = SQLSetConnectAttr (m_hdbc, SQL_ATTR_CURSOR_TYPE, (void*) SQL_CURSOR_DYNAMIC, <-- ___DYNAMIC___ CURSOR!!! SQL_LEN_BINARY_ATTR(SQL_CONCUR_VALUES)); CPPAMICIUnit 660-2d8 ENTER SQLSetConnectAttr SQLHDBC 00961758 SQLINTEGER 6 <SQL_ATTR_CURSOR_TYPE> SQLPOINTER 0x00000002 SQLINTEGER -104 CPPAMICIUnit 660-2d8 EXIT SQLSetConnectAttr with return code 0 (SQL_SUCCESS) SQLHDBC 00961758 SQLINTEGER 6 <SQL_ATTR_CURSOR_TYPE> SQLPOINTER 0x00000002 (BADMEM) SQLINTEGER -104 SQLRETURN ODBC_result = SQLSetConnectAttr(m_hdbc, SQL_ATTR_TXN_ISOLATION, (SQLPOINTER)lTxnStyle, SQL_IS_INTEGER); CPPAMICIUnit 660-2d8 ENTER SQLSetConnectAttr SQLHDBC 00961758 SQLINTEGER 108 <SQL_ATTR_TXN_ISOLATION> SQLPOINTER 0x00000002 SQLINTEGER -6 CPPAMICIUnit 660-2d8 EXIT SQLSetConnectAttr with return code 0 (SQL_SUCCESS) SQLHDBC 00961758 SQLINTEGER 108 <SQL_ATTR_TXN_ISOLATION> SQLPOINTER 0x00000002 (BADMEM) SQLINTEGER -6 ODBC_retval = SQLSetStmtAttr (m_hstmt, SQL_ATTR_CONCURRENCY, (SQLPOINTER) SQL_CONCUR_ROWVER, SQL_IS_UINTEGER); CPPAMICIUnit 660-2d8 ENTER SQLSetStmtAttr SQLHSTMT 00962F18 SQLINTEGER 7 <SQL_ATTR_CONCURRENCY> SQLPOINTER 0x00000003 SQLINTEGER -5 CPPAMICIUnit 660-2d8 EXIT SQLSetStmtAttr with return code 0 (SQL_SUCCESS) SQLHSTMT 00962F18 SQLINTEGER 7 <SQL_ATTR_CONCURRENCY> SQLPOINTER 0x00000003 (BADMEM) SQLINTEGER -5 ODBC_retval = SQLSetStmtOption(m_hstmt, SQL_ROWSET_SIZE, 1); CPPAMICIUnit 660-2d8 ENTER SQLSetStmtOption HSTMT 00962F18 UWORD 9 <SQL_ROWSET_SIZE> SQLPOINTER 0x00000001 CPPAMICIUnit 660-2d8 EXIT SQLSetStmtOption with return code 0 (SQL_SUCCESS) HSTMT 00962F18 UWORD 9 <SQL_ROWSET_SIZE> SQLPOINTER 0x00000001 (BADMEM) retvalue = SQLFetchScroll (m_hstmt, SQL_FETCH_ABSOLUTE, position); CPPAMICIUnit 660-2d8 ENTER SQLFetchScroll SQLHSTMT 00962F18 SQLSMALLINT 5 <SQL_FETCH_ABSOLUTE> SQLLEN 1 CPPAMICIUnit 660-2d8 EXIT SQLFetchScroll with return code -1 (SQL_ERROR) SQLHSTMT 00962F18 SQLSMALLINT 5 <SQL_FETCH_ABSOLUTE> SQLLEN 1 DIAG [HY106] The fetch type for PGAPI_ExtendedFetch isn't allowed with ForwardOnly cursor. (33) CPPAMICIUnit 660-2d8 ENTER SQLGetDiagRecW SQLSMALLINT 3 SQLHANDLE 00962F18 SQLSMALLINT 1 SQLWCHAR * 0x0012E2B8 (NYI) SQLINTEGER * 0x0012E60C SQLWCHAR * 0x009641B8 (NYI) SQLSMALLINT 500 SQLSMALLINT * 0x0012E3B0 CPPAMICIUnit 660-2d8 EXIT SQLGetDiagRecW with return code 0 (SQL_SUCCESS) SQLSMALLINT 3 SQLHANDLE 00962F18 SQLSMALLINT 1 SQLWCHAR * 0x0012E2B8 (NYI) SQLINTEGER * 0x0012E60C (33) SQLWCHAR * 0x009641B8 (NYI) SQLSMALLINT 500 SQLSMALLINT * 0x0012E3B0 (77)
* Re: ODBC + Dynamic cursors 2003-07-30 20:06 ODBC + Dynamic cursors Amanjit Gill <amanjit.gill@gmx.de> @ 2003-07-31 00:00 ` Hiroshi Inoue <Inoue@tpf.co.jp> 2003-07-31 06:55 ` Re: ODBC + Dynamic cursors Amanjit Gill <amanjit.gill@gmx.de> 0 siblings, 1 reply; 4+ messages in thread From: Hiroshi Inoue @ 2003-07-31 00:00 UTC (permalink / raw) To: Amanjit Gill <amanjit.gill@gmx.de>; +Cc: pgsql-odbc Amanjit Gill wrote: > > Hi, I have written a C++ ODBC wrapper that right now runs on > Oracle,Access,SQL Server, Sybase. > I am right now investigating PostgreSQL which we want to use instead of > SQL Server. > > PostgreSQL Version: 7.33 (Cygwin/Windows XP) using ipc-daemon > ODBC Version: 7.03.01.10 > OS: Windows XP Pro, SP1 > > Synopsis: > I basically open a connection to a db, create a statement,use a dynamic > cursor > via SQLSetConnectAttr (SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_DYNAMIC), Please set the SQL_ATTR_CURSOR_TYPE attribute for statement handles not for connection handles. Also note that psqlodbc driver doesn't support dynamic cursors. Please use keyset-driven or static cursors instead. [snip] > Another question: are positionable updates and deletes (which means > SQLSetPos) possible with > PostgreSQL at present (as mentioned in > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht > m/odch12pr_2.asp) ? No. What the driver supports is to update/delete/insert/.. a row (rows) in a rowset using SQLSetPos(.., .., SQL_UPDATE/DELETE/ADD, .. Positioned update/delete means updat/deleting a row in a rowset by executing a query such as UPDATE/DELETE ... WHERE CURRENT OF .... Please note that the examples in the page you specified are updat/deleting a row using SQLExecute. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/ ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: ODBC + Dynamic cursors 2003-07-30 20:06 ODBC + Dynamic cursors Amanjit Gill <amanjit.gill@gmx.de> 2003-07-31 00:00 ` Re: ODBC + Dynamic cursors Hiroshi Inoue <Inoue@tpf.co.jp> @ 2003-07-31 06:55 ` Amanjit Gill <amanjit.gill@gmx.de> 0 siblings, 0 replies; 4+ messages in thread From: Amanjit Gill @ 2003-07-31 06:55 UTC (permalink / raw) To: pgsql-odbc Dear Mr. Inoue, - Keyset driven cursors did the trick - Thank you for pointing out to set the attribute at the statement level - SQLSetPos() functionality basically does what I want to. Regards, Amanjit Gill Software Developer Medical and Bioinformatics UFK (Gynecology and Obstetrics) University Clinic Charite Berlin -----Ursprüngliche Nachricht----- Von: pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] Im Auftrag von Hiroshi Inoue Gesendet: Donnerstag, 31. Juli 2003 02:01 An: Amanjit Gill Cc: pgsql-odbc@postgresql.org Betreff: Re: [ODBC] ODBC + Dynamic cursors Amanjit Gill wrote: > > Hi, I have written a C++ ODBC wrapper that right now runs on > Oracle,Access,SQL Server, Sybase. I am right now investigating > PostgreSQL which we want to use instead of SQL Server. > > PostgreSQL Version: 7.33 (Cygwin/Windows XP) using ipc-daemon > ODBC Version: 7.03.01.10 > OS: Windows XP Pro, SP1 > > Synopsis: > I basically open a connection to a db, create a statement,use a > dynamic cursor via SQLSetConnectAttr (SQL_ATTR_CURSOR_TYPE, > SQL_CURSOR_DYNAMIC), Please set the SQL_ATTR_CURSOR_TYPE attribute for statement handles not for connection handles. Also note that psqlodbc driver doesn't support dynamic cursors. Please use keyset-driven or static cursors instead. [snip] > Another question: are positionable updates and deletes (which means > SQLSetPos) possible with > PostgreSQL at present (as mentioned in > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ > ht > m/odch12pr_2.asp) ? No. What the driver supports is to update/delete/insert/.. a row (rows) in a rowset using SQLSetPos(.., .., SQL_UPDATE/DELETE/ADD, .. Positioned update/delete means updat/deleting a row in a rowset by executing a query such as UPDATE/DELETE ... WHERE CURRENT OF .... Please note that the examples in the page you specified are updat/deleting a row using SQLExecute. regards, Hiroshi Inoue http://www.geocities.jp/inocchichichi/psqlodbc/ ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24.07.2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24.07.2003 ^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: ODBC + Dynamic cursors @ 2003-07-30 20:52 Janet Borschowa <borschow@roguewave.com> 0 siblings, 0 replies; 4+ messages in thread From: Janet Borschowa @ 2003-07-30 20:52 UTC (permalink / raw) To: Amanjit Gill <amanjit.gill@gmx.de>; pgsql-odbc Hi Amanjit, As far as I know, PostgreSQL ODBC doesn't support SQL_CURSOR_DYNAMIC so it is defaulting to SQL_CURSOR_FORWARD_ONLY and that's why you're seeing the error. Please try SQL_CURSOR_KEYSET_DRIVEN and I think you'll get the behavior you want. PostgreSQL ODBC does support SQLSetPos but you need to make sure to check the "Updatable cursors" checkbox in the driver setup. ======================== Janet Borschowa Software Engineer, Database Products Rogue Wave Software (541) 753-1931 FAX: (541) 757-4630 mailto:borschow@roguewave.com http://www.roguewave.com -----Original Message----- From: Amanjit Gill [mailto:amanjit.gill@gmx.de] Sent: Wednesday, July 30, 2003 1:06 PM To: pgsql-odbc@postgresql.org Subject: [ODBC] ODBC + Dynamic cursors Hi, I have written a C++ ODBC wrapper that right now runs on Oracle,Access,SQL Server, Sybase. I am right now investigating PostgreSQL which we want to use instead of SQL Server. PostgreSQL Version: 7.33 (Cygwin/Windows XP) using ipc-daemon ODBC Version: 7.03.01.10 OS: Windows XP Pro, SP1 Synopsis: I basically open a connection to a db, create a statement,use a dynamic cursor via SQLSetConnectAttr (SQL_ATTR_CURSOR_TYPE, SQL_CURSOR_DYNAMIC), execute the statement , bind some fields and want to fetch data using SQLFetchScroll (m_hstmt, SQL_FETCH_ABSOLUTE, lPosition). The SQLFetchScroll statement fails with the following message: 'HY106 - the fetch type for PGAPI_ExtendedFetch isn't allowed for ForwardOnly cursor.' Which of course irritates me because I explicitely use SQL_CURSOR_DYNAMIC. I attached the standard windows SQL.log with some mixins of the code I called. It is not the complete log and it is not the PostgreSQL-Driver specific log, which is far too verbose for me. I have enabled the Dynamic cursor checkbox in the driver. Any suggestions? Another question: are positionable updates and deletes (which means SQLSetPos) possible with PostgreSQL at present (as mentioned in http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht m/odch12pr_2.asp) ? Thanks for your help Amanjit Gill Software Developer Medical and Bioinformatics UFK (Gynecology and Obstetrics) University Clinic Charite Berlin --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 24.07.2003 ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-07-31 06:55 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2003-07-30 20:06 ODBC + Dynamic cursors Amanjit Gill <amanjit.gill@gmx.de> 2003-07-31 00:00 ` Hiroshi Inoue <Inoue@tpf.co.jp> 2003-07-31 06:55 ` Amanjit Gill <amanjit.gill@gmx.de> 2003-07-30 20:52 Re: ODBC + Dynamic cursors Janet Borschowa <borschow@roguewave.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox