I like Charles' train of thought, but after reading your post I'm thinking
something as simple as this might work for you:

update thisTABLE
where date1 > 20080000

All that example above does is bump RECCNT by 1 for every record that
matches your selection criteria (WHERE clause).
Would that suffice?
If not, can you give another example of existing RECCNT value and what you'd
like to set it to?


Celebrating 11-Years of SQL Performance Excellence on IBM i5/OS and OS/400

-----Original Message-----
Subject: Updating by row count in Interactive SQL

Hi all,
Any suggestions on how you would do this in interactive SQL?

counter = counter + 1
set RECCNT = counter
where date1 > 20080000

An example would be most appreciated. The above, obviously does not work.

The only two options I have in this case are SQL and UPDDTA record by

BTW, every now and then I see answers posted asking a good question -
why would you want to do that? - the hard way? I suspect it is usually
because we are working on a box with restrictions, no developer
environment, etc.

When we are in our native environment these questions (with simple
answers in another tool) don't pop up.

This thread ...


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

This mailing list archive is Copyright 1997-2020 by 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].