for looping - Mailing list pgsql-cygwin

From Michael Labhard
Subject for looping
Date
Msg-id aihm1g$9u1$1@main.gmane.org
Whole thread Raw
Responses Re: for looping
List pgsql-cygwin
Does FOR LOOP work on SELECT?  The following simple function looks good to
me but does not compile because of "missing .. at end of SQL expression".


CREATE FUNCTION get_all_diffs()
RETURNS FLOAT AS '
DECLARE
 i INTEGER := 0;
sym_diff FLOAT := 0.0;

BEGIN
 FOR row IN SELECT * FROM "tblTrades" LOOP
  i := i+1;
 END LOOP;

 RETURN sym_diff;
END;'

LANGUAGE 'plpgsql'
;

SELECT get_all_diffs();




pgsql-cygwin by date:

Previous
From: emailharvest@email.com
Date:
Subject: ADV: Harvest lots of E-mail addresses quickly !
Next
From: Michael Adler
Date:
Subject: Re: for looping