Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: Returning R...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 15507 of 16301
Post > Topic >>

Re: Returning RECORD from PGSQL without custom type?

by dante@[EMAIL PROTECTED] ("D. Dante Lorenso") May 12, 2008 at 02:23 PM

Tom Lane wrote:
> "D. Dante Lorenso" <dante@[EMAIL PROTECTED]
> writes:
>> I'd like to be able to do this:
>>
>> CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint)
>> RETURNS SETOF (col1name BIGINT, col2name TEXT, ...) AS
> 
> You realize of course that you can do this *today* if you use OUT
> parameters?

No, I didn't realize.  I always assumed OUT parameters were like return 
values from a function ... like:

   (out1, out2, out3) = somefunction (in1, in2, in3);

I never realized you could return a SETOF those OUT parameters.  I guess 
it wasn't intuitive, but I'm learning this now.

I think all the functionality I want DOES already exist.  Let me go work 
with it.  Thanks.

-- Dante




> 
> CREATE OR REPLACE FUNCTION "my_custom_func" (in_value bigint,
>   OUT col1name BIGINT, OUT col2name TEXT, ...)
>   RETURNS SETOF RECORD AS
> 
> The TABLE syntax is a bit more standards-compliant maybe, but it's not
> offering any actual new functionality.
> 
> 			regards, tom lane
> 


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




 6 Posts in Topic:
Returning RECORD from PGSQL without custom type?
dante@[EMAIL PROTECTED]   2008-05-10 00:41:20 
Re: Returning RECORD from PGSQL without custom type?
pavel.stehule@[EMAIL PROT  2008-05-12 11:12:07 
Re: Returning RECORD from PGSQL without custom type?
dante@[EMAIL PROTECTED]   2008-05-12 12:31:02 
Re: Returning RECORD from PGSQL without custom type?
tgl@[EMAIL PROTECTED] (T  2008-05-12 13:58:55 
Re: Returning RECORD from PGSQL without custom type?
dante@[EMAIL PROTECTED]   2008-05-12 14:23:29 
Re: Returning RECORD from PGSQL without custom type?
pavel.stehule@[EMAIL PROT  2008-05-12 20:47:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 22:32:37 CDT 2008.