Hi, Trying to get grip on FOR row IN select clause using this testfunction. The FOR row|record in is the one I can't get to work. CREATE FUNCTION dosomething (varchar) RETURNS integer AS ' DECLARE _conn_id ALIAS FOR $1; ts integer; cdrrec record; BEGIN ts := 0; FOR row IN SELECT * FROM cdr_accounting WHERE connection_id = _conn_id LOOP ts := ts + row.time_stamp END LOOP; return ts; END;' LANGUAGE 'plpgsql'; How to get this one to work ? Thanks, -- Feite Brekeveld [EMAIL PROTECTED] http://www.osiris-it.nl ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly