Skip to content

Commit

Permalink
fix atualiza_prescricao
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloarocha committed Jan 16, 2025
1 parent 9fbf1d8 commit 450f62f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion noharm-public.sql
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,14 @@ BEGIN
V_RESULTADO.dtvigencia := P_ORIGEM.dtvigencia;
END IF;

V_RESULTADO.aggsetor = P_ORIGEM.aggsetor || P_ORIGEM.fksetor;
V_RESULTADO.aggsetor := (
SELECT array_agg(DISTINCT elem)
FROM (
SELECT unnest(P_ORIGEM.aggsetor) AS elem
UNION ALL
SELECT P_ORIGEM.fksetor
) t
);

/**
* REGISTRAR CHECAGEM (utilizado para a flag checado anteriormente)
Expand Down

0 comments on commit 450f62f

Please sign in to comment.