From: Josh Berkus <josh@agliodbs.com>
To: AKM Molla <amolla@professo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: rowset Return from postgresql
Date: Thu, 31 May 2001 09:03:59 -0700
Message-ID: <web-65016@davinci.ethosmedia.com> (raw)
In-Reply-To: <PKEBLGPHOFIMPKHMALHLIEJLCAAA.amolla@professo.com>
AKM,
> I know you have an workaround idea to retrieve rowset (Resultset
> in
> JDBC) from PostGres function call in 7.1. I was looking at mailing
> archive
> to find but was not successful. If you please help me out stating
> your
> ideas, I will appreciate that.
I can understand that. The "search" function for the list archives
seems to be rather non-functional.
Folks, is there anything we can do to enhance/fix the archive search?
Hub.org people? Right now I'm keeping my own archive so that I can
search it through Netscape!
The answer to your question, in a simplified form for using PL/pgSQL
functions to return rowsets for complex searches:
1. Create a sequence "search_sq"
2. Create a table searches (
search_sq INT4,
key_no INT4,
CONSTRAINT PRIMARY KEY search_PK (search_sq, key_no) );
3. Create a view (sv_results) that defines the column set you want to
see.
4. Create a function ("search_it") that:
a. grabs the s_key := Nextval('search_sq'),
b. INSERT INTO searches SELECT s_key, key_no from sv_results
WHERE ... (dynamically defined criteria)
c. Return the s_key from the function.
5. Query from you front-end app on sv_results JOIN searches where
search_sq = s_key.
This works quite well, especially for web applications.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, amolla@professo.com
Subject: Re: rowset Return from postgresql
In-Reply-To: <web-65016@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox