I would like something like this:
UPDATE tab1
SET name = descr = proc1(name)
WHERE id < 1000
unlike double calling:
UPDATE tab1
SET name = proc1(name),
descr = proc1(name)
WHERE id < 1000
Is that possible?
I would like something like this:
UPDATE tab1
SET name = descr = proc1(name)
WHERE id < 1000
unlike double calling:
UPDATE tab1
SET name = proc1(name),
descr = proc1(name)
WHERE id < 1000
Is that possible?
Not as you write. I assume that proc1
is expensive/time consuming to invoke? If so, you may be able to use a subquery, at the cost of doing an additional join:
UPDATE tab1
SET name = p.p1n
descr = p.p1n
FROM (
SELECT id, proc1(name)
FROM tab1
) p(id, p1n)
WHERE tab1.id = p.id
AND tab1.id < 1000;