loop Through Query Results : Record - Mailing list pgsql-novice

From DAVANNE Eric - NTR
Subject loop Through Query Results : Record
Date
Msg-id 0D740BCE2280D411A1E00001029E60180475FF8B@NTRMES04
Whole thread Raw
Responses Re: loop Through Query Results : Record
Re: loop Through Query Results : Record
List pgsql-novice
Hello,
I'm trying to loop Through Query Results
For example :
- I have a table with few user to create .
create table userToCreate(name varchar )

- I create a function :
create function createuser() return int2 AS'
declare
        username RECORD;
begin
  for username in select name from userToCreate loop
     CREATE USER username.name;
  end loop ;
return 1;
end
' LANGUAGE 'sql';

I don't understand why i get this error :
An error has occured in pdAdmin II:frmSQLInput.cmdExecute_Click:
Number : -2147467259
Description ERROR: parser error at or near "record"

Does someone can help me ?

thank's

pgsql-novice by date:

Previous
From: "David P. Lurie"
Date:
Subject: Re: configure script failure with SCO 5.0.7
Next
From: joseph speigle
Date:
Subject: Re: loop Through Query Results : Record