Skip site navigation (1) Skip section navigation (2)

Re: Problems with stored procedure (function)

From: Marco Craveiro <marco(dot)craveiro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problems with stored procedure (function)
Date: 2009-12-19 14:19:17
Message-ID: d23da9a0912190619n30e845c0w1a6968f56ad221c4@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
Tom,

This is indeed the answer to my problem, thanks very much. Any newbie
googling for an answer to this question may also be interested in the
following series of articles:

QUICK GUIDE TO WRITING PLPGSQL FUNCTIONS:

Part 1: http://www.postgresonline.com/journal/index.php?/archives/58-Quick-Guide-to-writing-PLPGSQL-Functions-Part-1.html
Part 2: http://www.postgresonline.com/journal/index.php?/archives/76-Quick-Guide-to-writing-PLPGSQL-Functions-Part-2.html
Part 3: http://www.postgresonline.com/journal/index.php?/archives/83-Quick-Guide-to-writing-PLPGSQL-Functions-Part-3-NOTICES,-RECURSION,-and-more.html

Thanks

Marco

On 18/12/2009, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Marco Craveiro <marco(dot)craveiro(at)gmail(dot)com> writes:
>> The problem I have is my function keeps on returning a single column
>> with the name of the function, rather than something akin to the table
>> I've defined:
>
>> sanzala=# select load_country();
>>     load_country
>> --------------------
>>  (a,"b ","c  ",123)
>> (1 row)
>
> Yes, because that's what that syntax says to do: return one
> composite-type column.  The easiest way to expand it is
>
> 	select * from load_country();
>
> 			regards, tom lane
>


-- 
It's the golden rule: those who have the gold, rule. -- Gerald Celente

In response to

pgsql-novice by date

Next:From: listsDate: 2009-12-19 15:42:42
Subject: How to use a db in UTF-8 encoding under Windows
Previous:From: Tom LaneDate: 2009-12-18 19:33:20
Subject: Re: Problems with stored procedure (function)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group