Login Register Actian.com  

Actian Community Forum


Go Back   Actian Community Forums > Ingres Forums > Database General
 

Reply
 
LinkBack Thread Tools Display Modes
Old 2012-02-21   #1 (permalink)
Ingres Community
 
Join Date: Aug 2010
Posts: 17
Default [ODBC] Cursor has not been opened for update

Hi,

I'm having a problem here with an ODBC connection.
Selects are ok, but write access is failing with "Cursor [name] has not been opened for update".
The driver is not set to read_only and the connection is even opened with ALLOWUPDATE=Y.

The server is 10.1, the client 10.0 - both Windows.
The server is configured to
cursor_update_mode = DEFERRED
cursor_default_open = UPDATE

Any idea what I'm doing wrong? I have no access to the application source code...
ingres42 is offline   Reply With Quote
Old 2012-02-21   #2 (permalink)
Ingres Community
 
Join Date: Mar 2007
Location: Medfield, Massachusetts, USA
Posts: 231
Default

Try issuing for the statement in question, an ODBC SQLSetStmtAttr( hstmt, SQL_ATTR_CONCURRENCY, SQL_CONCUR_VALUES, ...). The ODBC specification says that the default is SQL_CONCUR_READ_ONLY, that the cursor is read-only, and that no updates are allowed.

Hope this helps,
Dave
thoda04 is offline   Reply With Quote
Old 2012-02-21   #3 (permalink)
Ingres Community
 
Join Date: Aug 2010
Posts: 17
Default

How would I change this when I don't have access to the source code? I cannot see if it says "for update".
As mentioned above, the connection is opened with SQL_DATA_SOURCE_READ_ONLY = N and the default cursor mode is UPDATE.
ingres42 is offline   Reply With Quote
Old 2012-02-24   #4 (permalink)
Junior Member
 
Join Date: Feb 2012
Posts: 3
Default

Check that the cursor is not defined as read only. Use the FOR UPDATE clause that helps the data base manager to decide whether a cursor is updatable or not.
ThomasAnderson is offline   Reply With Quote
Old 2012-02-24   #5 (permalink)
Ingres Community
 
Join Date: Aug 2010
Posts: 17
Default

Well, again, I have no access to the source code :\
How can I check if it's read only or not? I have the windows odbc trace log. The only thing I see there is "<SQL_DATA_SOURCE_READ_ONLY> == N".
I did look for <SQL_SCROLL_CONCURRENCY> but I can't see (or interpret) if it's set to <SQL_CONCUR_VALUES> or anything...

The very same application runs fine with Oracle and MSSQL.
ingres42 is offline   Reply With Quote

Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© 2011 Actian Corporation. All Rights Reserved