RWDBCursor write fails at runtime sometimes with a syntax error

Article ID: 840
Last updated: 05 Feb, 2008
Article ID: 840
Last updated: 05 Feb, 2008
Revision: 1
Views: 2893
Posted: 15 Aug, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


I have an cursor object created like this:

    RWDBCursor myCursor = mySelector.cursor(RWDBCursor::Sequential, RWDBCursor::Write);  

Sometimes I get a runtime error: Syntax error. Why?


Cause


When you create an RWDBCursor with Write, a column list for the FOR UPDATE clause is needed. If you do not pass it (with an RWDBSchema object), then DBTools will use an empty column list, which will result in an empty FOR UPDATE clause - a syntax error.


Action


Make sure you pass in a valid column list when creating a RWDBCursor with Write. Create a schema object with the column list and pass it to the cursor:

   RWDBCursor myCursor = mySelector.cursor(myschema,RWDBCursor::Sequential, RWDBCursor::Write);
This article was:   Helpful | Not helpful
Report an issue
Article ID: 840
Last updated: 05 Feb, 2008
Revision: 1
Views: 2893
Posted: 15 Aug, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category