Lorem Ipsum/DOL Differet Solmena

Separat existentie 2010 Unee MYT por scientie, musica, sport etc, litot Europa usa li sam Vocabular Lingues, differe solmen in li grammatica, li pronunciation. Delete this widget in Dashboard and add yours. This is just an example. Read More

Re: PB y PostgreSQL

martes, 15 de julio de 2014

Alli tienen un ejemplo

CREATE OR REPLACE FUNCTION su_ma_par.fu_mpa_lista_act_de_zona(character varying, character varying, character varying)
  RETURNS character varying AS
$BODY$
/*
$1 cod entidad
$4 cod zona
$3 Dato: (N)ombre / (NE) Nombre  + Enter
*/
Declare
    vo_resp     varchar;
    ro_act     record;
Begin
    if $1 is null or $2 is null or $3 is null then
        return null;
    end if;
  
    vo_resp = '';
    For ro_act in Select a.nom_actividad from mpa_mae_actividades a
    inner join          mpa_tab_zonas_act t on
          a.cod_actividad = t.cod_actividad
          Where t.cod_entidad = $1 and t.cod_zona = $2 loop

       if $3 = 'N' then                
      vo_resp = vo_resp || ro_act.nom_actividad || ' - ';
       else
      vo_resp = vo_resp || ro_act.nom_actividad || chr(13);
       end if;   
  
end loop;
if length(vo_resp) > 0  then
    if $3 = 'N' then
        vo_resp = substr(vo_resp ,1 , length(vo_resp) - 3);
    else
        vo_resp = substr(vo_resp ,1 , length(vo_resp) - 1);
    end if;
end if;
return trim(vo_resp);
end
$BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;
ALTER FUNCTION su_ma_par.fu_mpa_lista_act_de_zona(character varying, character varying, character varying)


El 3 de julio de 2014, 12:40, Alberto Cuevas <betocuevas.net@gmail.com> escribió:
Buenas tardes estimados, alguien en lista que trabaje con PB y PostgreSQL?

Mi pregunta es la siguiente es posible crear DW de tipo Stored Procedure con una Función de PostgreSQL, como se hace en SQL Server, como haria?



--

---
Has recibido este mensaje porque estás suscrito al grupo "TechEra" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a techeraz9+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

--

---
Has recibido este mensaje porque estás suscrito al grupo "TechEra" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a techeraz9+unsubscribe@googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.

0 comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.