pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedwhat's wrong in this procedure?
5+ messages / 5 participants
[nested] [flat]
* what's wrong in this procedure?
@ 2011-02-25 17:46 Camaleon <tarsis.lima@gmail.com>
2011-02-25 18:33 ` Re: what's wrong in this procedure? Adrian Klaver <adrian.klaver@gmail.com>
2011-02-25 21:39 ` Re: what's wrong in this procedure? Rob Sargent <robjsargent@gmail.com>
2011-03-01 07:56 ` Re: what's wrong in this procedure? Vibhor Kumar <vibhor.kumar@enterprisedb.com>
0 siblings, 3 replies; 5+ messages in thread
From: Camaleon @ 2011-02-25 17:46 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: what's wrong in this procedure?
2011-02-25 17:46 what's wrong in this procedure? Camaleon <tarsis.lima@gmail.com>
@ 2011-02-25 18:33 ` Adrian Klaver <adrian.klaver@gmail.com>
2011-02-25 18:38 ` Re: what's wrong in this procedure? Yeb Havinga <yebhavinga@gmail.com>
2 siblings, 1 reply; 5+ messages in thread
From: Adrian Klaver @ 2011-02-25 18:33 UTC (permalink / raw)
To: pgsql-sql
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'
--
Adrian Klaver
adrian.klaver@gmail.com
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: what's wrong in this procedure?
2011-02-25 17:46 what's wrong in this procedure? Camaleon <tarsis.lima@gmail.com>
2011-02-25 18:33 ` Re: what's wrong in this procedure? Adrian Klaver <adrian.klaver@gmail.com>
@ 2011-02-25 18:38 ` Yeb Havinga <yebhavinga@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: Yeb Havinga @ 2011-02-25 18:38 UTC (permalink / raw)
To: Adrian Klaver <adrian.klaver@gmail.com>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: what's wrong in this procedure?
2011-02-25 17:46 what's wrong in this procedure? Camaleon <tarsis.lima@gmail.com>
@ 2011-02-25 21:39 ` Rob Sargent <robjsargent@gmail.com>
2 siblings, 0 replies; 5+ messages in thread
From: Rob Sargent @ 2011-02-25 21:39 UTC (permalink / raw)
To: pgsql-sql
On 02/25/2011 10: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
>
Single quotes (') not double quotes (")
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: what's wrong in this procedure?
2011-02-25 17:46 what's wrong in this procedure? Camaleon <tarsis.lima@gmail.com>
@ 2011-03-01 07:56 ` Vibhor Kumar <vibhor.kumar@enterprisedb.com>
2 siblings, 0 replies; 5+ messages in thread
From: Vibhor Kumar @ 2011-03-01 07:56 UTC (permalink / raw)
To: pgsql.sql@googlegroups.com; +Cc: pgsql-sql
On Feb 25, 2011, at 11:16 PM, 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';
try Following:
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';
Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
vibhor.kumar@enterprisedb.com
Blog:http://vibhork.blogspot.com
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2011-03-01 07:56 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 17:46 what's wrong in this procedure? Camaleon <tarsis.lima@gmail.com>
2011-02-25 18:33 ` Adrian Klaver <adrian.klaver@gmail.com>
2011-02-25 18:38 ` Yeb Havinga <yebhavinga@gmail.com>
2011-02-25 21:39 ` Rob Sargent <robjsargent@gmail.com>
2011-03-01 07:56 ` Vibhor Kumar <vibhor.kumar@enterprisedb.com>
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