Skip site navigation (1) Skip section navigation (2)

Re: loop Through Query Results : Record

From: joseph speigle <joe(dot)speigle(at)jklh(dot)us>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: loop Through Query Results : Record
Date: 2004-03-25 15:00:08
Message-ID: 20040325150008.GB32079@www.sirfsup.com (view raw or flat)
Thread:
Lists: pgsql-novice
hi,

try tablename.RECORD   ??


On Thu, Mar 25, 2004 at 03:51:59PM +0100, DAVANNE Eric - NTR wrote:
> 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
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

-- 
joe speigle
www.sirfsup.com

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2004-03-25 15:53:17
Subject: Re: configure script failure with SCO 5.0.7
Previous:From: DAVANNE Eric - NTRDate: 2004-03-25 14:51:59
Subject: loop Through Query Results : Record

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group