Archives of the TeradataForum
Message Posted: Mon, 18 Mar 2002 @ 14:57:50 GMT
May be this may help - this is the same kind of situation i was in and i had do away with stored procedures and hence do away with cursors and replace it with only sql.
This is what i did : i made use of the UPDATE FROM statement. Here you could create a derived table on the run and do what ever computation you would necessary want to do within the derived table and then use that to update your rows.
In fact i replaced all my cursors using the above and more over no STORED PROCEDURES in use.
Now the SELECT that is used inside (as shown above) can again be derived.
So this deriving does give a flexibility if the logic you are trying to arrive at takes more steps, more over you could the CASE construct within the SELECTS which makes it more flexible.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|