Re: How to create Function which retruns username and password
От | A. Kretschmer |
---|---|
Тема | Re: How to create Function which retruns username and password |
Дата | |
Msg-id | 20090902083339.GA31088@a-kretschmer.de обсуждение исходный текст |
Ответ на | How to create Function which retruns username and password (venkat <ven.tammineni@gmail.com>) |
Список | pgsql-sql |
In response to venkat : > Dear All, > > I want to create function which returns username and password from the > database.I have users table in the database.in that i have username and > password columns.I need return username and password using functions.it is > urgent. I am waiting for your great response, test=# create table usernames (username text, passwort text); CREATE TABLE test=*# create or replace function get_usernames() returns setof usernames as $$ begin return query select username, passwortfrom usernames; end;$$ language plpgsql; CREATE FUNCTION test=*# insert into usernames values ('user1', 'password1'); INSERT 0 1 test=*# insert into usernames values ('user2', 'password2'); INSERT 0 1 test=*# select * from get_usernames();username | passwort ----------+-----------user1 | password1user2 | password2 (2 rows) HTH, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
В списке pgsql-sql по дате отправления: