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

Re: loop Through Query Results : Record

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: DAVANNE Eric - NTR <EDavanne(at)nanterre(dot)sema(dot)slb(dot)com>
Cc: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: loop Through Query Results : Record
Date: 2004-03-25 16:17:29
Message-ID: 11900.1080231449@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
DAVANNE Eric - NTR <EDavanne(at)nanterre(dot)sema(dot)slb(dot)com> writes:
> 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';

That function is written in plpgsql language, not sql language.

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Joe BordesDate: 2004-03-25 18:48:10
Subject: Re: how to test string against regular expression contained in postgresql database field?
Previous:From: Tom LaneDate: 2004-03-25 15:53:17
Subject: Re: configure script failure with SCO 5.0.7

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