From: Yeb Havinga <yebhavinga@gmail.com>
To: Adrian Klaver <adrian.klaver@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: what's wrong in this procedure?
Date: Fri, 25 Feb 2011 19:38:52 +0100
Message-ID: <4D67F73C.8090608@gmail.com> (raw)
In-Reply-To: <4D67F615.5060909@gmail.com>
References: <080608d1-b5ea-4b40-8042-f21867f97cc8@glegroupsg2000goo.googlegroups.com>
<4D67F615.5060909@gmail.com>
On 2011-02-25 19:33, Adrian Klaver wrote:
> On 02/25/2011 09:46 AM, Camaleon wrote:
>> This error is returned Erro de SQL:
>>
>> ERROR: column "Aguardando Pagto" does not exist at character 352>>>
>>
>>
>> create or replace function get_historico() RETURNS SETOF
>> twiste.type_cur__historico AS '
>>
>> SELECT o.data_fim, sum(t.num_itens * t.valor) AS total,
>> count(t.*) AS transacoes
>> FROM ofertas o
>> JOIN transacao t ON o.ofertas_id = t.ofertas_id
>> JOIN municipio m ON o.municipio_id = m.municipio_id
>> WHERE o.data_fim<= now() AND t.status IN("Aguardando Pagto", "Em
>> anĂ¡lise", "Aprovado", "Completo")
>> GROUP BY o.data_fim;
>> '
>> language 'sql';
>>
>>
>>
>>>> the column is t.status and not "Aguardando Pagto";
>>>> what's wrong ? thanks
>>
>
> Try single quotes, 'Aguardando Pagto'
and also
create or replace function get_historico() RETURNS SETOF
twiste.type_cur__historico AS $$
instead of
create or replace function get_historico() RETURNS SETOF
twiste.type_cur__historico AS '
together with the corresponding
$$
language 'sql';
instead of
'
language 'sql';
at the end
regards,
Yeb Havinga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: yebhavinga@gmail.com, adrian.klaver@gmail.com
Subject: Re: what's wrong in this procedure?
In-Reply-To: <4D67F73C.8090608@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox