From: | Raymond O'Donnell <rod(at)iol(dot)ie> |
---|---|
To: | juniorfreire <juniorfreire(at)gmail(dot)com> |
Cc: | pgadmin-support(at)postgresql(dot)org |
Subject: | Re: function create error |
Date: | 2013-03-14 15:13:30 |
Message-ID: | 5141E91A.30208@iol.ie |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-support |
On 14/03/2013 14:52, juniorfreire wrote:
> --
> -- Name: fc_mesextenso(integer, character varying); Type: FUNCTION; Schema:
> public; Owner: sigmasol
> --
>
> CREATE FUNCTION public.fc_mesextenso(integer, character varying) RETURNS
> text
> LANGUAGE plpgsql
> AS $_$
> declare
> iMes alias for $1;
> sTipoRetorno alias for $2;
> sNomeMes text;
> sSiglaMes text;
>
> begin
> select nome, sigla
> into sNomeMes,
> sSiglaMes
> from (values (1::integer, 'Janeiro'::text, 'Jan'::text),
> (2::integer, 'Fevereiro'::text, 'Fev'::text),
> (3::integer, 'Março'::text, 'Mar'::text),
> (4::integer, 'Abril'::text, 'Abr'::text),
> (5::integer, 'Maio'::text, 'Mai'::text),
> (6::integer, 'Junho'::text, 'Jun'::text),
> (7::integer, 'Julho'::text, 'Jul'::text),
> (8::integer, 'Agosto'::text, 'Ago'::text),
> (9::integer, 'Setembro'::text, 'Set'::text),
> (10::integer, 'Outubro'::text, 'Out'::text),
> (11::integer, 'Novembro'::text, 'Nov'::text),
> (12::integer, 'Dezembro'::text, 'Dez'::text)) as meses(mes,
> nome, sigla)
> where mes = iMes;
>
> if sTipoRetorno = 'nome' then
> return sNomeMes;
> else
> return sSiglaMes;
> end if;
> end;
> $_$;
>
>
> ALTER FUNCTION public.fc_mesextenso(integer, character varying) OWNER TO
> sigmasol;
>
What is your question?
Ray.
--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Laggner | 2013-03-15 14:57:31 | pgadmin 1.14.0 Ubuntu12.04 "Failed to write to history file!" AND "KATASTROPHE, kann die Logdatei nicht öffnen!" |
Previous Message | juniorfreire | 2013-03-14 14:52:43 | function create error |