> SELECT INTO _id id FROM _tabela order by id desc limit 1; ok I ve found that EXECUTE 'SELECT id FROM ' || quote_ident(_tabela) ||' order by id desc limit 1' INTO _id; ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly