You are here:

Ingres/Error in update

Advertisement


Question
Hello again.

I have a present problem which i cannot solve.
I have a simple update command but will generate this error:

sqlstate=50000
[Ingres][Ingres 3.0 ODBC Driver]Error trying to replace a record.

I am updating only a single column without any reference.

I tried same update on a different database and it works.
I guess this is something to do with indexing.
Any insight regarding this issue.

Thanks in advance.

Cheers,
JB  

Answer
Hello JB,

This error is well knowed since Ingres 5.* and is part of a "familly" of sames error saying :
- error trying to get a record (case of SELECT)
- error trying to put a record (case of INSERT)
- error trying to replace a record (case of UPDATE)

It is often due to one of the following :
- table structure corruption
- index corruption
- no left space on device (linked to your location)

It can never be due to SQL syntax itself. Corruption can happen due to Ingres bugs ...

What to do then ?
First, check errlog.log. You might find a clear message containing the name of the table and the complete path of the file linked to the table. Some errors before and after this message should confirm the structure corruption or the lake of space on the device.

If you need space : add some :-)

In the others cases :
1/ take a checkpoint (ckpdb) : it is the only supported method to have a backup of your file (if you want to investigate with Ingres support or so on)
1-bis/ If you do not want (or can not) ckpdb your database try to copydb your table. With a little chance you should be able to read a part or all of your table, that mean all your data are not completly lost
2/ Check you have somewhere the SQL to reconstruct table structure, indexes, views and all objects linked to this table (because you will prehap's need to recreate the table)

Then try :
MODIFY your_table TO heap
if it not work, try this (OS command) :
verifydb -mrun -sdbname your_db -udba -otable table_name
at the end of this operation your table should be in HEAP, all indexes dropped

Then you should "just" recreate indexes and modify the table again.

Hope this help you,
Regards.
Jean-Pierre

Ingres

All Answers


Answers by Expert:


Ask Experts

Volunteer


Jean-Pierre Zuate

Expertise

Any questions about database Ingres (owned by Computer Associates then Ingres Corp) : - Ingres 6.4 - OpenINGRES from 1.0 to 2.0 - IngresII from 2.0 to 2.6 - Ingres R3, Ingres 2006 (Open Source version) - Ingres 9.x, Ingres 10.x - All tool around Ingres : ABF, Report Writer, Replicator, OpenROAD (3.5 to 2006), Ingres/NET Ingres/STAR, ...

Experience

16 years of computing experience as :
- AS400 programmer
- AIX / Ingres administrator and developer (OpenROAD and korn shell)
- Ingres DataBase Administrator
- Ingres expert - Data modelisation - ETL - Reporting - Many of Computer Associates sofwares - ITIL / CMDB / Change Management

Organizations
http://lafageconseil.fr

Education/Credentials
Computing bachelor (1989)

Past/Present Clients
More than 100 customers during my 6 years of CA has an Ingres consultant, all around France and Africa (Togo, Cameroon, Morrocco, ...)

©2012 About.com, a part of The New York Times Company. All rights reserved.