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



The ID is correct on READ.

Rather than hoping to find every UPDATE, I just put a trap in an existing trigger pgm.



-----Original Message-----
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Wednesday, February 07, 2018 9:31 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Identity value of 0

<snip>
I do a read then update the row based on the data structure with the client data.
</snip>
Ok, so on your update, what is the value of ID right before the UPDATE statement?
READ table
table.ID = clientDataStructure.id
...
UPDATE table

What is the value of table.ID right before the UPDATE?

Again, this is a good time to use %FIELDS.
`
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Justin Taylor <JUSTIN@xxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 02/07/2018 10:16 AM
Subject: RE: Identity value of 0
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>



I read the row and pass the whole thing to the client. The client passes
the whole row back on an update request, which I put in a data structure
(based on the table record). I do a read then update the row based on the
data structure with the client data.




-----Original Message-----
From: Rob Berendt [mailto:rob@xxxxxxxxx]
Sent: Wednesday, February 07, 2018 8:53 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Identity value of 0

I'm still trying to figure out why you got a zero in that column. Look at
this scenario You do your first insert. Your identity column is set to 1.
You do a READ. "ID"=1.
You do an update. It should write back out a 1.
The only way it should write out a zero (sans your rfe) is if you did a
WRITE, no READ, and then a UPDATE. Or if you cleared, or reset your
values in between the READ and the UPDATE. Can you run that in debug and
see a value for ID right before the UPDATE? Does it write that out? If
ID is equal to anything other than a zero prior to the UPDATE then I would
think this a PTF issue and not an rfe issue.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.