Re: Functions with dynamic queries

From: Gabriel Dovalo Carril <dovalo(at)terra(dot)es>
To: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
Cc: Lista SQL de postgres <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Functions with dynamic queries
Date: 2002-05-25 01:11:01
Message-ID: 3CEEE4A5.EF729BB@terra.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> What do you get when you just run the SQL from the
> command line?

It works fine in command line .

> I am assuming that something is actually returned for
> both sums: if there are no values for either "stkreal"
> or "stkpteser" for "codarticulo = '020220064'", then a
> null will be returned, which will turn the final
> result into a null...
> If there are null values anywhere in those columns,

No, there are no NULL values.

Try attached scripts. They are only examples, (no real data)
They are very, very simple and fails in the same situation.

The only difference between then is line 19

(func_error.sql)
Select people.age into person

(func_nodata.sql)
Select max(people.age) as age into person

The first one returns:
ERROR: record person is unassigned yet

And the second one:
get_age
---------

(1
row)

--
Gabriel Dovalo.

Attachment Content-Type Size
func_error.sql text/plain 518 bytes
func_nodata.sql text/plain 530 bytes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Julian Scarfe 2002-05-26 10:00:11 XSD to Postgresql SQL
Previous Message Christopher Kings-Lynne 2002-05-25 00:04:01 Re: Trees in SQL