Re: sql function: using set as argument - Mailing list pgsql-sql

From Akshay Mathur
Subject Re: sql function: using set as argument
Date
Msg-id 003b01c5ad64$502edaf0$9701a8c0@pune.wibhu.com
Whole thread Raw
In response to sql function: using set as argument  ("Akshay Mathur" <akshay.mathur@airtightnetworks.net>)
List pgsql-sql

Found a solution

 

Second function can be written as

            Get_count(anyarray, int)

                                    Select count(b_column) from some_table where some_field_1 any ($1) and some_field_2 = $2;

 

Calling this function:

            Select Get_count(array(function_1), int_value)

 

Regards,

 

akshay

 

 

---------------------------------------

Akshay Mathur

SMTS, Product Verification

AirTight Networks, Inc. (www.airtightnetworks.net)

O: +91 20 2588 1555 ext 205

F: +91 20 2588 1445

 

-----Original Message-----
From: Akshay Mathur [mailto:akshay.mathur@airtightnetworks.net]
Sent:
Wednesday, August 10, 2005 8:00 PM
To: 'pgsql-sql@postgresql.org'
Subject: sql function: using set as argument

 

Hi,

 

I have a function that returns a set.

Looks like:

            Select a_column from a_table where some_condition;

 

I want to use output of this function as an argument of another function

            Second looks like:

                        Get_count(result_set_of_function_1, int)

                                    Select count(b_column) from some_table where some_field_1 in ($1) and some_field_2 = $2;

 

Please suggest how can I do that?

 

Regards,

 

akshay

 

 

---------------------------------------

Akshay Mathur

SMTS, Product Verification

AirTight Networks, Inc. (www.airtightnetworks.net)

O: +91 20 2588 1555 ext 205

F: +91 20 2588 1445

 

pgsql-sql by date:

Previous
From: Chris Travers
Date:
Subject: Re: insert only if conditions are met?
Next
From: "Ricky Sutanto"
Date:
Subject: Performance issue