×
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.
Tried the LF trick with no luck.
If I have this table:
CREATE TABLE ROB/RCTS
(MYKEY CHAR ( 5),
MYDATA CHAR ( 30),
ts timestamp not null
for each row on update as row change timestamp,
PRIMARY KEY (MYKEY))
And I entered a few rows in there.
Then I created this LF:
RCTSL01
UNIQUE
R RCTSL1R PFILE(RCTS)
MYKEY
MYDATA
K MYKEY
And used this RPGLE:
FRCTSL01 UF E K DISK
/free
*inlr=*on;
setll *loval rctsl01;
read rctsl01;
dOW not %eof(rctsl01);
mydata='9';
update RCTSL1R;
read rctsl01;
ENDDO;
Then all of the timestamps should be set to the current date/time and not
what was read in from the file, right? Since we used a LF that omitted
that column we shouldn't be reading in the whole data row.
However, after running the program I have:
MYKEY MYDATA TS
a 9 2009-05-29-11.37.54.345211
't' 9 2009-05-29-11.41.38.876905
******** End of data ********
But a simple sql statement works fine:
update rob/rcts
set mydata='x'
where mykey='a'
MYKEY MYDATA TS
a x 2009-05-29-11.55.33.205847
't' 9 2009-05-29-11.41.38.876905
Using the new lf doesn't update it.
update rob/rctsl01
set mydata='y'
where mykey='a'
MYKEY MYDATA TS
a y 2009-05-29-11.55.33.205847
't' 9 2009-05-29-11.41.38.876905
Tried a sql view
create view rctsv01
as (select mydata, mykey from rob/rcts)
update rob/rctsv01
set mydata='z'
where mykey='a'
and I still get
MYKEY MYDATA TS
a z 2009-05-29-11.55.33.205847
't' 9 2009-05-29-11.41.38.876905
Basically I find ROW CHANGE TIMESTAMP as a big disappointment and I
recommend using a trigger to maintain it.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.