From: | "Josh Berkus" <josh(at)agliodbs(dot)com> |
---|---|
To: | "AKM Molla" <amolla(at)professo(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: rowset Return from postgresql |
Date: | 2001-05-31 16:03:59 |
Message-ID: | web-65016@davinci.ethosmedia.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
From | Date | Subject | |
---|---|---|---|
Next Message | Mark | 2001-05-31 16:22:48 | Date manipulation |
Previous Message | Stephan Szabo | 2001-05-31 15:37:48 | RE: primary key scans in sequence |