× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I believe it is possible to get the RRN (or is it Row Number) of
the just-inserted record
using get diagnostics immediately following the 1st insert.

You can then delete that record, if needed, using the RRN

HTH
Gad




date: Fri, 13 May 2022 19:10:59 +0000
from: Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>
subject: RE: How to Undo an SQL Insert

Unfortunately, the file does not have a unique key or auto-id field, and
it is not currently journaled. It's one of the biggest files on our system
@ 36 million rows. As a transaction file, rows are never deleted (only
inserted).

Some more info
I have never used journaling before (no rollback or commit).
My procedure is inside a service program that updates other files
(COMMIT=*NONE).
This service pgm is used all over the place.

So if I turn on journaling for this file would it journal all
transactions? Or just those from my program? All other programs updating
this file do so via RPG (not SQL).

For now, I have added an extra SQL statement to check for the condition
before attempting to insert - but that only checks for the condition that I
have anticipated.
This will most likely take care of any issue, but...

-


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.