Re: Error 458: Long transaction aborted.
Posted in 1999
Tan Chin Yeow wrote:
> Recently, I've encounter this error 458 when trying to
> - delete all records in a particular table
Several options:
1. drop and recreate the table
2. write a stored procedure to select each record individually and delete it
define row_id int;
foreach select rowid into row_id from tablename
delete from tablename where rowid = row_id
end foreach
3. write a 4gl routine to select each record individually and delete it
define row_id int
declare del_curs cursor for select rowid from tablename
foreach del_curs into row_id
delete from tablename where rowid = row_id
end foreach
4. insert a where clause in your delete statement
delete from tablename where primarykey_column [ is in some range ]
> - load data from a text file into the same table
Have you tried the dbload command? Or breaking up the file into several smaller
files? Or write a c function to read each record in and insert it individually?
The bigger issue you are encountering is that engine treats the delete and the
load (I assume you're running them from isql or dbaccess) as one very large
logical transaction; that is to say, there is an implied "begin work" before
your delete/load statement, and an implied "commit work" after the statement.
The catch is, you are running out of logical logs before the action can
complete, so the engine is forced to rollback your work.
A better fix to this problem would be to increase your number of logical logs,
or logical log size, or both. This assumes you have the resources (disk) to
allocate. Either way, the above options will do in a pinch.
-mka
Michael Ackerbauer
SP System Test
(914) 433-4993
T/L 293-4993