Re: [GENERAL] MOVE cursor in plpgsql?

2007-02-11 Thread Webb Sprague
> Is there a way to move a cursor in plpgsql in the same way as in > regular sql? ... Wouldn't it be easier to list the parts in a random order (simply ORDER BY RANDOM()) and then use modulo by number of actors (but there's no ROWNUM so a loop is needed anyway). Something like... I think you a

Re: [GENERAL] MOVE cursor in plpgsql?

2007-02-11 Thread Tomas Vondra
> Hi all, > > Is there a way to move a cursor in plpgsql in the same way as in > regular sql? The function below would like to move the cursor back to > the start each time the cursor runs out of rows, creating pairs of > integers that are randomly put together. > > The "motivation" for this is

[GENERAL] MOVE cursor in plpgsql?

2007-02-10 Thread Webb Sprague
Hi all, Is there a way to move a cursor in plpgsql in the same way as in regular sql? The function below would like to move the cursor back to the start each time the cursor runs out of rows, creating pairs of integers that are randomly put together. The "motivation" for this is to randomly ass

Re: [GENERAL] Move cursor

2005-03-22 Thread Bruce Momjian
-Message d'origine- > De : Michael Fuhr [mailto:[EMAIL PROTECTED] > Envoy? : mardi 8 mars 2005 18:29 > ? : Tom Lane > Cc : FERREIRA William (COFRAMI); pgsql-general@postgresql.org > Objet : Re: [GENERAL] Move cursor > > > On Tue, Mar 08, 2005 at 12:16:28PM -0500,

Re: [GENERAL] Move cursor

2005-03-09 Thread FERREIRA William (COFRAMI)
Title: RE: [GENERAL] Move cursor does i hope that CURSOR will be fully implemented soon ? (or maybe you know an alternative for my problem ? :) ) -Message d'origine- De : Michael Fuhr [mailto:[EMAIL PROTECTED]] Envoyé : mardi 8 mars 2005 18:29 À : Tom Lane Cc : FERREIRA Wi

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 12:16:28PM -0500, Tom Lane wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > I don't think PL/pgSQL implements cursors fully. > > Its cursor facility is certainly far weaker than what's presently in the > main SQL language. I think this is at least partly historical ac

Re: [GENERAL] Move cursor

2005-03-08 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > I don't think PL/pgSQL implements cursors fully. Its cursor facility is certainly far weaker than what's presently in the main SQL language. I think this is at least partly historical accident (ie we upgraded the main language and forgot about plpgsql).

Re: [GENERAL] Move cursor

2005-03-08 Thread Michael Fuhr
On Tue, Mar 08, 2005 at 04:23:37PM +0100, FERREIRA William (COFRAMI) wrote: > i need to use the MOVE function on a cursor, for extracting special rows. > the function is written in pl/pgSQL I don't think PL/pgSQL implements cursors fully. In particular, I don't see MOVE in the PL/pgSQL parser; I

[GENERAL] Move cursor

2005-03-08 Thread FERREIRA William (COFRAMI)
Title: iterate over refcursor hi   i need to use the MOVE function on a cursor, for extracting special rows. the function is written in pl/pgSQL   CREATE OR REPLACE FUNCTION TEST()    RETURNS void AS $$DECLARE     childCursor CURSOR FOR select * from ... childRecord adoc.xdb_c