How to loop through all table rows and perform subquery using values of same row?
Answer based on comments originally left by Akina

UPDATE table 
SET valA = xml.value(_parsing queryA_), 
    valB = xml.value(_parsing queryB_)


When you use a column name in the right-hand side of an assignment expression (parsing expression in your case) it is referenced to a column value in the same record that is currently being updated (if you want to think about an update like it is a record-by-record process). It is always the same row field. Referencing a column in another row is always more complex (needs a window function or another reference to the table).

To continue processing a partially-updated you could add WHERE reference &gt; last_ref to the SET clause of the UPDATE. Your WHERE clause will determine whether each record will be updated or not.

A better way may be to check valA and/or valB values for NULL - if not then the record was already processed previously. For example UPDATE ... WHERE valA IS NULL (an index on the tested field will help). If it is possible that some of the columns will remain null after processing, it is a good idea to set it to some non-NULL value (empty string or single space, for example).