Hi,
 You said that cursors are updateable. So how come I get the previous error:
>>SQLRETURN ret = SQLPrepare(m_stmt, (SQLCHAR *)stmt,                                  
>                                         (SQLINTEGER)strlen(stmt));
>>The stmt variable contains "SELECT COUNT(*) FROM nuance.ndb__mmp WHERE >>nuance_key 
>= ?" I get the following error: SQL_ERROR - [SAP AG][SQLOD32 >>DLL][SAP DB]General 
>error;-7008
>>POS(100) Updates of this table not allowed. (errcode -7008, sql state >>"S1000")
How can I execute the above query (and others) and obtain an updateable cursor. (The 
data base provider code I am working on sets 
>>SQLSetStmtOption(m_stmt, SQL_CONCURRENCY, SQL_CONCUR_LOCK);
for all prepared statements.)
regards,
  Ajit

-----Original Message-----
From: Koetter, Thomas Theodor [mailto:thomas.theodor.koetter@;sap.com] 
Sent: Wednesday, October 30, 2002 8:16 PM
To: ajit_cus; [EMAIL PROTECTED]
Subject: RE: SQLprepare ODBC problem

Hi Ajit,

> -----Original Message-----
> From: ajit_cus [mailto:ajit_cus@;infosys.com]
[snip]
>  The only statement concurrency currently being used is:
> 
> ret = SQLSetStmtOption(m_stmt, SQL_CONCURRENCY, SQL_CONCUR_LOCK);
> 
> I would like to continue to use this as this code is in a 
> database provider to a third party application which works 
> with other Databases too. Is SQL_CONCUR_LOCK not supported? 

It is. The ODBC docu writes for this attribute:


        Locking. The cursor uses the lowest level of locking necessary to make
        sure it can update or delete rows in the result set. This usually results in
        very low concurrency levels, especially at the Repeatable Read and
        Serializable transaction isolation levels. 

and
        SQL_CONCUR_LOCK = Cursor uses the lowest level of locking
        sufficient to ensure that the row can be updated.


So, if you do a "select count(*) from ..." you request a updatable result set.

> It is known to work with Oracle/db2/Sybase.

What did happen, if you try to update the result set (e.g. via SQLSetPos) of
the SQL statement above?


>  Could someone confirm that Cursors under SAP DB ODBC are read only?

No, there can be updatable.



Regards  Thomas

----------------------------------------------
Dr. Thomas K�tter
SAP DB, SAP Labs Berlin


SAP DB is open source. Get it!    www.sapdb.org 


 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to