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, passwort from 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 | password1 user2 | 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 -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql