Re: Isolating a record column from a PL-Pgsql function call ? - Mailing list pgsql-general

From Gauthier, Dave
Subject Re: Isolating a record column from a PL-Pgsql function call ?
Date
Msg-id 482E80323A35A54498B8B70FF2B8798003E58E4C6B@azsmsx504.amr.corp.intel.com
Whole thread Raw
In response to Re: Isolating a record column from a PL-Pgsql function call ?  (Andreas Kretschmer <akretschmer@spamfence.net>)
Responses Re: Isolating a record column from a PL-Pgsql function call ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Re: Isolating a record column from a PL-Pgsql function call ?  (Sam Mason <sam@samason.me.uk>)
List pgsql-general
The example I gave was overly simplistic.  I actually want to look at more than one of the columns in the returned
record,so rewritting it to return an int won't address the need for the other columns.  And no, it does not return a
set/arrayof records.  It returns just one record.   

If I run the function outside of a query, it returns something like...

"(myvcharval1,myvcharval2,myintval)"

Notice the parens, the commas and the lack of single quotes around the "myvcharval(x)" values.

I suppose I could do some funky string dissection with this, but I was wondering if there was something more
straignt-forward.

-dave

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Andreas Kretschmer
Sent: Tuesday, December 16, 2008 2:51 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Isolating a record column from a PL-Pgsql function call ?

Gauthier, Dave <dave.gauthier@intel.com> schrieb:

> Hi:
>
>
>
> I have a PL-Pgsql function that returns a record of a type that have 4 elements
> (columns).  Let's say the first element/column is called "id_num".  Is there a
> way I can specify the id_num element of the record returned from iside a query?
>
>
>
> For example, select col1 from thetable where my_plpgsql_fn(col2).id_num = 123;

I think, you should rewrite your function to hand over the id_num as
additional parameter. But i'm not sure if i understand you corrently. Is
this a setof-returning function?

Please, show us your real function, maybe someone can help you more.




Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: Isolating a record column from a PL-Pgsql function call ?
Next
From: Madison Kelly
Date:
Subject: Re: TIMESTAMP with a timezone offset