SesarDB

Home Tables Schemas Diagrams Foreign Keys Indexes
update_current_archive() - Procedure
Name update_current_archive()
Comment
Src
CREATE OR REPLACE FUNCTION update_current_archive() 
  RETURNS smallint AS 
$$

DECLARE r RECORD;
BEGIN 	
	FOR r IN select * from peng_org where sesar_name in (select distinct current_archive from sample) LOOP
	update sample set current_archive = r.org_name where sample.current_archive = r.sesar_name;	
    END LOOP;
    return 1;
 end;
$$
  LANGUAGE plpgsql VOLATILE 
  COST 100;