Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4VG44E23604 for ; Thu, 31 May 2001 12:04:04 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 65016; Thu, 31 May 2001 09:03:59 -0700 From: "Josh Berkus" Subject: Re: rowset Return from postgresql To: "AKM Molla" Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Thu, 31 May 2001 09:03:59 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200105/357 X-Sequence-Number: 3198 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