From: | Charles Bai <charlesbaiusa(at)yahoo(dot)com> |
---|---|
To: | postgre sql- <pgsql-novice(at)postgresql(dot)org> |
Subject: | Procedure with out parameters. |
Date: | 2005-11-23 17:59:23 |
Message-ID: | 20051123175923.61287.qmail@web31911.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Hi,
I can not get a procedure with output parameter created. Right now, I am getting error on the line of "uid := newid;". If I remove the line, I got error saying that "Function myuser_insert(...) does not exist". Can anyone point out what's wrong here? - thanks. I want to retrieve the new UserID generated by the insert command.
CREATE FUNCTION myuser_insert(IN" mail" "varchar", IN" pass" "varchar", OUT" uid" int8) AS
$BODY$declare
newid int8 := 0;
begin
select into newid nextval('myuser_userid_seq');
insert into myuser (userid, email, pwd) values (newid, mail, pass);
uid := newid;
end$BODY$
LANGUAGE 'plpgsql' VOLATILE;
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Kretschmer | 2005-11-23 18:18:48 | Re: Linux DB designer tools |
Previous Message | Zouari Fourat | 2005-11-23 17:52:06 | Linux DB designer tools |