pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to create Function which retruns username and password
2+ messages / 2 participants
[nested] [flat]
* How to create Function which retruns username and password
@ 2009-09-02 08:05 venkat <ven.tammineni@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: venkat @ 2009-09-02 08:05 UTC (permalink / raw)
To: pgsql-sql
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,
Thanks,
Regards,
Ven
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to create Function which retruns username and password
@ 2009-09-02 08:33 A. Kretschmer <andreas.kretschmer@schollglas.com>
parent: venkat <ven.tammineni@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: A. Kretschmer @ 2009-09-02 08:33 UTC (permalink / raw)
To: 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, 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2009-09-02 08:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-09-02 08:05 How to create Function which retruns username and password venkat <ven.tammineni@gmail.com>
2009-09-02 08:33 ` A. Kretschmer <andreas.kretschmer@schollglas.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox