Clever Code or Foolish Functions?

In an attempt to be more efficient (and because I apparently have the short-term memory of a goldfish) I've developed some code to go at the end of my procedure for adding new login accounts for T_CUST_LOGIN while tending to the T_NEXT_ID table that I always seem to forget to update.  The code is as follows:

UPDATE T_NEXT_ID
SET T_NEXT_ID.next_id = (select max(eaddress_no) from T_EADDRESS)
where T_NEXT_ID.type='AD' and (select next_id from T_NEXT_ID where type='AD') <> (select max(eaddress_no) from T_EADDRESS)

What do you think, Tessiturians?  It should work, right?

BONUS ICHTHYOCENTRIC TRIVIA: The oldest recorded age of a goldfish is 41.

Parents Reply Children