Opened 9 years ago

Closed 9 years ago

#122 closed enhancement (fixed)

Intégration SANDRE mise à jour des localisations anatomiques

Reported by: cedric Owned by: cedric
Priority: major Milestone: Release R 0.4
Component: database Version: 0.4
Keywords: sandre Cc:

Description (last modified by cedric)

/* ticket 110 Marion
problèmes de clés étrangères sur la base
*/
/* fonction ref.updatesql
Cette fonction permet de lancer des requêtes de mise à jour dans tous les schemas
*/
CREATE OR REPLACE FUNCTION ref.updatesql(myschemas varchar[],scriptsql text)RETURNS int AS $$

DECLARE
totalcount int;
nbschema int;
i integer;
BEGIN

select INTO nbschema array_length(myschemas,1);
i=1;
While (i <=nbschema) LOOP

EXECUTE 'SET search_path TO '
myschemas[i]', public';

EXECUTE scriptsql;
i=i+1;
END LOOP;

RETURN nbschema;
END;
$$

LANGUAGE 'plpgsql' ;
COMMENT ON FUNCTION ref.updatesql (myschemas varchar[],scriptsql text) IS 'fonction pour lancer un script de mise à jour sur chaque schema';

/*
Insertions dans la tables des localisations anatomiques
*/
INSERT INTO ref.tr_localisationanatomique_loc values ('W','Tronc');
INSERT INTO ref.tr_localisationanatomique_loc values ('K','Pédoncule caudal');
INSERT INTO ref.tr_localisationanatomique_loc values ('P','Nageoire pelvienne');
select ref.updatesql('{"azti","bgm","bresle","charente","fd80","iav","inra","logrami","migado","migradour","mrm","saumonrhin","smatah"}',
'INSERT INTO bgm.ts_maintenance_main(main_ticket,main_description) values (122,Mise à jour des localisations anatomiques)');

Change History (7)

comment:1 Changed 9 years ago by cedric

  • Description modified (diff)
  • Milestone set to release 0.5
  • Status changed from new to accepted

comment:2 in reply to: ↑ description Changed 9 years ago by cedric

Replying to cedric:

INSERT INTO ref.tr_localisationanatomique_loc values ('W','Tronc');
INSERT INTO ref.tr_localisationanatomique_loc values ('K','Pédoncule caudal');
INSERT INTO bgm.ts_maintenance_main(main_ticket,main_description) values ('122','Mise à jour des localisations anatomiques');

comment:3 in reply to: ↑ description Changed 9 years ago by cedric

Replying to cedric:

INSERT INTO ref.tr_localisationanatomique_loc values ('W','Tronc');
INSERT INTO ref.tr_localisationanatomique_loc values ('K','Pédoncule caudal');
INSERT INTO bgm.ts_maintenance_main(main_ticket,main_description) values ('122','Mise à jour des localisations anatomiques');

comment:4 Changed 9 years ago by cedric

  • Description modified (diff)
  • Milestone changed from release 0.5 to Release v0.4
  • Version changed from 0.5 to 0.4

comment:5 Changed 9 years ago by cedric

  • Description modified (diff)

comment:6 Changed 9 years ago by cedric

  • Description modified (diff)

comment:7 Changed 9 years ago by cedric

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.