pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vince DiCiero <vdiciero@home.com>
To: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Subject: RE: [INTERFACES] Methods for stepping through results?
Date: Tue, 16 Feb 1999 18:58:45 -0600
Message-ID: <01BE59DE.62197580.vdiciero@home.com> (raw)



On Tuesday, February 16, 1999 9:47 AM, Tom Lane [SMTP:tgl@sss.pgh.pa.us] wrote:
> Matthew Hagerty <matthew@venux.net> writes:
> > Is there any way to do the following:
> > 1.  Return a query in groups of x (i.e. 10 or 20) and progressively return
> > result groups of x.  Just think of search engine navigation.
> 
> DECLARE CURSOR ... FETCH ...
> 
> 
> > 2.  I have a client who wants to be able to select certain rows (tuples) of
> > a result and then "re-submit" the query and have only those rows selected
> > in the new results.  For example, if a query returns 10 rows and rows
> > 2,4,7,9 are checked, when re-submitted only rows 2,4,7,9 would be returned.
> >  I know it is kind of stupid, but I have to please the customer :(
> 
> Seems like something you should be handling inside your application.
> Why would you "re-submit" the same query in the first place, if you
> already have the results?
>
I don't think he wants to resubmit the same query, what he wants is to perform
a secondary query on the results of the first.
Probably what you should do is create a temporary table with the results of the first
query "SELECT INTO ...."
Use the DECLARE CURSOR to scroll through the results of the 1st query.
Then for the 2nd query, perform the query on the temporary table.

If you realy do want to do it as stated above where the re-submitted query only
returns the selected items from the first query, then why don't you display the
results of the first query in a list, and delete the unwanted items instead of performing
a 2nd query ? 



view thread (5+ messages)

Message-ID: <01BE59DE.62197580.vdiciero@home.com>
Permalink:  ../01BE59DE.62197580.vdiciero@home.com/
Also on:    postgresql.org/message-id/01BE59DE.62197580.vdiciero@home.com

 · 

reply

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-interfaces@postgresql.org
  Cc: vdiciero@home.com
  Subject: RE: [INTERFACES] Methods for stepping through results?
  In-Reply-To: <01BE59DE.62197580.vdiciero@home.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