Re: [SQL] NO DATA FOUND Exception

2007-06-26 Thread Fernando Hevia
>>"Fernando Hevia" <[EMAIL PROTECTED]> 2007-06-26 16:25 >>> >>How do I refer a specific field of the returned row from outside the >>function? How should I write the query in order to show only fields 1 and 3, for example? >In case you would like to use set returning functions... >  >if your func

Re: [SQL] NO DATA FOUND Exception

2007-06-26 Thread Bart Degryse
In case you would like to use set returning functions... if your function will return records with the same structure as an existing table CREATE FUNCTION my_func() RETURNS SETOF my_table AS ... if not you have to define the returning type CREATE TYPE func_row AS ("field1" varchar(10), "field2

Re: [SQL] NO DATA FOUND Exception

2007-06-26 Thread Fernando Hevia
On Jun 25, 2007, at 17:05, Michael Glaesemann wrote: >[Please create a new message to post about a new topic, rather than >replying to and changing the subject of a previous message. This will >allow mail clients which understand the References: header to >properly thread replies.] Wasn't

Re: [SQL] NO DATA FOUND Exception

2007-06-25 Thread Michael Glaesemann
[Please create a new message to post about a new topic, rather than replying to and changing the subject of a previous message. This will allow mail clients which understand the References: header to properly thread replies.] On Jun 25, 2007, at 14:20 , Fernando Hevia wrote: Is something l

Re: [SQL] NO DATA FOUND Exception

2007-06-25 Thread Fernando Hevia
>On Mon, Jun 25, 2007 at 04:20:37PM -0300, Fernando Hevia wrote: >> when <> then return variable; >> when <> then <> ; >> when <> then <> ; > >Check out the FOUND variable in the documentation for the first two, >and the "trapping errors" section for the latter. > >Andrew Sullivan | [EMAIL

Re: [SQL] NO DATA FOUND Exception

2007-06-25 Thread Andrew Sullivan
On Mon, Jun 25, 2007 at 04:20:37PM -0300, Fernando Hevia wrote: > when <> then return variable; > when <> then <> ; > when <> then <> ; Check out the FOUND variable in the documentation for the first two, and the "trapping errors" section for the latter. A -- Andrew Sullivan | [EMAIL PRO

[SQL] NO DATA FOUND Exception

2007-06-25 Thread Fernando Hevia
Hi. Im taking my first steps with plpgsql. I want my function to react to the result of a query in the following way: begin select column into variable from table where condition; exception when <> then return variable; when <> then <> ; when <> then <> ; end ; Is something like this pos