467,925 Members | 1,893 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

Hast Du das schon gewußt?

Habe ich gerade entdeckt ...

Man kann einen SELECT um einen UPDATE ... machen und dadurch das
"aktualisierte Ergebnis gleich holen.

Knut Stolze wrote:
Serge Rielau wrote:
UPDATE TABLE2 SET TS = CURRENT TIMESTAMP WHERE ID = (SELECT
FIELD1 FROM TABLE1 WHERE FIELD2 = {GET_VALUE_FROM_INPUT});

And then the SELECT from the UPDATE wouldn't be an issue anymore...

Oh, he wants to get the id back? No problem!
SELECT id FROM OLD TABLE(UPDATE TABLE2 SET TS = CURRENT TIMESTAMP WHERE
ID = (SELECT FIELD1 FROM TABLE1 WHERE FIELD2 = {GET_VALUE_FROM_INPUT}));

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Feb 24 '06 #1
  • viewed: 917
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Peter Hänsel | last post: by
1 post views Thread by André | last post: by
250 posts views Thread by Sugapablo | last post: by
1 post views Thread by Thomas Tawarritsch | last post: by
2 posts views Thread by Kay | last post: by
3 posts views Thread by Olaf Rabbachin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.