|
Ange
Also you could check for the existence of the record first by a chain with the keyfield and if it doesn't exist then you could attempt to write it.
Rizwan
-----Original Message-----
From: Fabrice CALMELAT [SMTP:f.calmelat@itech-international.com]
Sent: Thursday, December 07, 2000 1:23 AM
To: RPG400-L@midrange.com
Subject: RE: beginner's question
What it means is :
- Your file Test28 has a key (one or more fields).
- The UNIQUE keyword is used in the DDS of your file (TEST28).
TEST28 is a file that can be accessed by a key (CHAIN in RPG) and the key
has to be unique. You get the error message because your program tries to
add a new record in TEST28, but, the record your trying to add has a key
that already exist in TEST28.
I hope this helps,
Fabrice Calmelat
ITech International Ltd - http://www.itech-international.com
+44 (0) 798 99 77 601
-----Original Message-----
From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On
Behalf Of ange
Sent: 07 December 2000 08:12
To: RPG400-L@midrange.com
Subject: beginner's question
hi, all
I want to add records to and update the same file in one of my RPG
program. I used as follow in my F specs.
FTEST28 UF A E K DISK
and I used WRITE to add the records and UPDATE to update the records?
The compile is passed, but when I run it, I met the message: '
Attempt to write a duplicate record to file TEST28 (C G D F).'
What is the problem? Thanks.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
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.