How to fix error -245 while updating row in informix - sql-update

-245 Could not position within a file via an index.
I got this error when I want to update one row in a table.
There are 8 indexes on this table and the table has about 30000 rows.
Here is the full description for this error
The database server encountered an error when it attempted to look up
a row through an index. Check the accompanying ISAM error code for
more information. The table file or the index file might have been
corrupted. Unless the ISAM error code or an operating-system message
points to another cause, run the oncheck utility (secheck with IBM
Informix SE or tbcheck with IBM Informix OnLine) to check and repair
table and index.

We would need to the ISAM error to answer this question properly.
Usually this is due to locking, review application locking strategy and isolation levels and well as access plans for DML.

Related

Why do I see read-write error message when creating a table or inserting rows?

I keep getting a "could not open read-write messages" when creating a table or inserting rows?
2022-10-21T17:27:11.336011Z I i.q.c.l.t.LineTcpMeasurementScheduler could not create table [tableName=cpu, ex=could not open read-write
io.questdb.cairo.CairoException: [22] could not open read-only [file=/root/.questdb/db/cpu/service.k]
I have tried the troubleshoot solution given in QuestDB forums but it does not work.
If you could explain why it does not work along with the solution, I would appreciate it.
There are possibilities for insufficient limits for the maximum number of open files. Try and change that limit for your device. You can check more about that here
I think that the syntax which you used was incorrect. Have you checked, whether the table was created properly or not ?
If not, create the table
CREATE TABLE my_table(symb SYMBOL, price DOUBLE, ts TIMESTAMP, s STRING) timestamp(ts);
After creating the table properly, then try to insert the rows.
You are likely hitting a bug which was fixed recently:
https://github.com/questdb/questdb/pull/2627
The fix will be released in the upcoming 6.5.4 release.
Unfortunately not out yet.
Please, try 6.5.4 when it is released, should be out in the next few days.

How to check if a CRecordset field has already been fetched?

I'm using a CDatabase*/CRecordset* duo to read a HFSQL (windev) database through an ODBC DSN.
There are many issues with HFSQL's handling of binary blobs, especially when they're empty.
One such problem causes my app to fire warnings and exceptions on loop as I read a table. I use a custom class that manages the recordset and fetches every field once, in ascending ordinal order, and stores the resulting CDBVariant vars in a vector for my own later uses. The error I get alternates between Warning: ODBC Success With Info on field 8. when the field has content and Error: GetFieldValue operation failed on field 8. Data already fetched for this field. when it has none. Clearly, I have not fetched the field before, so either the wrong error message is displayed or the CRecordset believes it is correct and I should be able to detect it beforehand.
How could I go about detecting whether my CRecordset considers a field to have already been fetched? GetODBCFieldInfo does not give me any useful information, have I missed something?

PowerBI subscription error : there is no data for the field at position x

We have run a PowerBI subscription to generate visualisations report in PDF format we have get many errors like this
There is no data for the field at position x
The problem is we searched many times about it we found that it may occurred due to missing data in dataset.
But we have about 30 datasets with a query to oracle database we cannot figure out which is the missing data and the log does not mention which report causes the error.
Is there a way to figure out which field is missing?
Or is there a way to enrich the reports error log to give us which report failed?
A sample of exact error is repeated with different positions :
processing!ReportServer_0-8!1e18!02/07/2022-09:56:36:: e
ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: There is no data for the field at position 29.;
Dears
I found a solution help me. I will share it.
The error is due to missing data, not missing values, which means the column name defined in the data set field has been changed in the database.
note:
When make the value equals null it will not give the same error; even if it is used in the report it will give a different error.
about how to detect ?
Simply install report builder in machine has connection to this database and open this report with report builder and make verify fields, it will give detailed error with the name of dataset fields not found so we tracked it in database we found it has been changed so fix it in either dataset or column name in database it fix the issue.
New challenge we are going to handle it either column name exist or changed to e, never get error and give empty report better as there is some database the report will connect may not have the same column names so it should give empty part of report instead of error.
thanks BR,

CRecordset fails on adding a new row using the free ODBC driver for SQLite

I have an C++ application using MFC CRecordset to add rows to a table of an SQLite database, using the free ODBC driver by Ch. Werner. For this, I use the usual sequence of rs.Open(), rs.AddNew(), set values, and finally rs.Update().
This works on a small example, but with my actual database rs.Update() fails with error -1 and the following error message: unrecognized token: ""RedFaktorFly" (1). The 'token' is a truncated name of column 14 of the table, whose full name is "RedFaktorFlyt".
In some runs, it appends seemingly random characters, so the message becomes for ex. unrecognized token: ""RedFaktorFlyH" (1).
Interestingly, when I add "LongNames=true" to the ODBC connection string, which prepends table names to the column names and therefore makes the SQL query longer, the error becomes (for ex.) unrecognized token: ""K_Noder.MaxKompresjox" (1) - where "MaxKompresjonsFaktor" is the name of column 10 of the table.
This seems to suggest that there is a limit on the length of a SQL query accepted by the driver - but it seems strange that such a limit would be so small that it would fail already with 14 columns.
I do not think that the limit is in the C++ part, since the same code works fine both with the (commercial) SQLite driver from Devart and with Microsoft's ODBC driver for Access.
I tried adding a TraceFile option to the ODBC connection string, but it does not seem to do anything, so I do not know what exactly gets sent to the ODBC driver.
I see the same behaviour both with 32- and 64-bit builds, using Visual Studio 2015 on Windows 10.
Any suggestions what to try next?
I'll give you a solution to solve your issue completely. I don't know if it's suitable for you, but definitely it works. I successfully use it on my own.
For any operation except listing records, use CDatabase, not CRecordset. So, to insert rows to any table, to update records, to delete records, use CDatabase. To retrieve records from SQLLite database, use CRecordset. I can give you examples if you need.

Recordset Update errors when updating sql_variant field

I'm using C++ and ADO to add data to a SQL Server 2005 database. When calling the Recordset Update method for a sql_variant column I'm getting the error DB_E_ERRORSOCCURRED and the error message Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. If the value I'm adding is NULL all works fine and all values going to the fields that are not sql_variant types work.
Does anyone know what I might be doing wrong?
Thanks
[Edit] I have some more information. The value we are storing is the empty string - ADO appears to want to store this in the sql_variant as a nchar(0), which of course is not a valid SQL data type. Is there a way to get an empty string in a sql_variant using the ADO batch commands?
You are only being shown the outer-most error there and as the error suggest you need to check the inner errors to find out the problem.
Apologies, I'm a VB developer but if you loop through the errors on your connection object you should be able to pinpoint the actual error.
From my classic ADO days multiple-step errors usually pointed at trying to stuff something to big into your column, e.g a string thats too big or a number with too high precision.
Hope this helps.
Ed