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

Re: Procedure with out parameters.

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Charles Bai <charlesbaiusa(at)yahoo(dot)com>
Cc: postgre sql- <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Procedure with out parameters.
Date: 2005-11-23 19:18:12
Message-ID: c2d9e70e0511231118h18cb97famb6ce4e75bb05ed58@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 11/23/05, Charles Bai <charlesbaiusa(at)yahoo(dot)com> wrote:
> 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;
>

what is error message...

for now suspect of this:

> CREATE FUNCTION myuser_insert(IN" mail" "varchar", IN" pass" "varchar", OUT"
> uid" int8) AS

what are the quotes for? " mail": is this a valid name?

check your function....

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

In response to

pgsql-novice by date

Next:From: Andrej Ricnik-BayDate: 2005-11-23 20:41:20
Subject: Re: Linux DB designer tools
Previous:From: Roland GieslerDate: 2005-11-23 19:11:18
Subject: Re: Linux DB designer tools

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