Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get UpdateBatch to work with DB2

Status
Not open for further replies.

WebWeasel

Programmer
Feb 5, 2001
2
US
I connect to a DB2 database, get one record, and when I try to update the database with UpdateBatch I get an error message that the table is "an undefined name," even though the table was found okay to fetch the recordset. If I try to do a Resync, the error will be "Insufficient key column information for updating or refreshing."

The exact same code works fine for SQL Server and Oracle. The only change I made for DB2 is the "for update" keyword in the SQL.

The row I select contains a primary key which is unique. I'm using the IBM DB2 ODBC driver. It's a static, client-side recordset with an optimistic lock. I can't see any reason why I can't update unless there is a problem with the ODBC driver. Is there a fix I'm not aware of?
 
The "undefined name" message results from case sensitivity on table names when using shaped recordsets.

The "insufficient key column information" was because, contrary to what I was led to believe, a primary key was never defined for the tables -- all they had was a unique index. A primary key must be defined on the table (and included in the recordset).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top