Re: Help on function creating

From: Aaron Koning <aaronkoning(at)gmail(dot)com>
To: Alexandre Gonçalves Jacarandá <clark_vr(at)yahoo(dot)com(dot)br>
Cc: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Help on function creating
Date: 2005-12-07 19:36:55
Message-ID: 1319fbba0512071136q212dfedag10aad63af0ad152@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Have you considered using a view to create the report?

Aaron

On 12/7/05, Alexandre Gonçalves Jacarandá <clark_vr(at)yahoo(dot)com(dot)br> wrote:
>
> Hello everyone, I'm using postgresql form an year and I have some
> difficult to write a function to make an report. I'm running PostgreSQL
> 7.5.3 on i686-pc-linux-gnu (Mandriva 10.1). My table structure is:
> Tabela "public.matricula"
> Column | Type | Modifiers
>
>
> -------------------------+--------------------------+-------------------------------------------------
> id | integer | not null default
> nextval('seq_matricula'::text)
> ref_contrato | integer |
> ref_pessoa | integer |
> ref_campus | integer |
> ref_curso | integer |
> ref_periodo | character varying(10) |
> ref_disciplina | integer |
> ref_curso_subst | integer |
> ref_disciplina_subst | integer |
> ref_disciplina_ofer | integer |
> nota | double precision | default 0
> nota_exame | double precision | default 0
> nota_final | double precision | default 0
> conceito | character varying(5) | default
> ''::character varying
> conceito_exame | character varying(5) | default
> ''::character varying
> conceito_final | character varying(5) | default
> ''::character varying
>
> I need to have an output like:
> ref_pessoa | ref_disciplina1 | ref_disciplina2 | ... | ref_disciplina n
> 1 | nota_final1 | nota_final2 | ... | nota_final n
>
> How can I make this ? I know that I need to declare an variable an than
> make an for - loop, but I don't know how. Where can I get some examples
> for this?
> Thanks.
>
> --
> __________________________
> Alguns caminham pelo arco,
> eu caminho pela reta.
>
> Alexandre Gonçalves Jacarandá
> Assessor de Tecnologia de Informação
> Tel.: 0 ** 21 8131-2313
>
>
>
>
>
>
>
> _______________________________________________________
> Yahoo! doce lar. Faça do Yahoo! sua homepage.
> http://br.yahoo.com/homepageset.html
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Leif B. Kristensen 2005-12-07 23:06:44 Error from trigger
Previous Message Richard Huxton 2005-12-07 18:57:07 Re: constrains problem...