× 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.



"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 06/14/2018 08:41:03
AM:
When performing writes to a table with one of these fields using RGPLE
RLA
I thought that the UniqueID column in the RPG program was just ignored
and
a new unique ID assigned.

However I find I'm sometimes getting some duplicate key errors which are
definitely with the Table ( not other indices ) and the primary key on
the
table is just the identity column.

Obviously with an SQL Write, I can specify a list of fields, excluding
the
identity column.

In RPG is it necessary to use Data Structures on the DB operations to
also
specify a list of fields which excludes the ID column?

I haven't convinced myself 100 percent, but this issue only seemed to
appear when I was calling the program and then switching library lists
and
calling the program again.


You mentioned other indexes. Does that mean you confirmed that
the duplicate key wasn't occurring with a secondary unique key rather than
the primary?

Otherwise... I haven't used RLA to write to a table with an
identity column. However, comparing to using SQL, you cannot include the
identity column in your RLA WRITE. SQL has the advantage of extended
indicators so that you can include, but ignore, the identity column. You
don't have that luxury in RPG RLA. So, you must omit the identity column
for your RPG RLA access.

That said... There can definitely be an issue with switching
library lists if the file/table in question is a different file/table in
another library. In this case, the file should be user-controlled and an
explicit CLOSE issued -- unless you're using the cycle and setting the
*INLR indicator before switching library lists. In other words, you must
make sure the file is hard-closed before switching library lists.


Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.