1.
DO $$ DECLARE rec_compvalue RECORD; cur_compvalue CURSOR FOR SELECT * from t_compvalue where compvalue_nocomp like 'Wyk%'; BEGIN -- Open the cursor OPEN cur_compvalue; LOOP -- fetch row into the film FETCH cur_compvalue INTO rec_compvalue; -- exit when no more row to fetch EXIT WHEN NOT FOUND; UPDATE t_compvalue SET compvalue_nocomp=convert_from(decode(compvalue_nocomp,'base64'),'UTF8') WHERE CURRENT OF cur_compvalue; RAISE NOTICE 'Output: %',rec_compvalue.compvalue_nocomp; END LOOP; -- Close the cursor CLOSE cur_compvalue; END; $$View Code
标签:cur,--,base64,游标,nocomp,pg,rec,compvalue From: https://www.cnblogs.com/jonvy/p/17374608.html