From: | "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Cc: | "Ted Byers" <r(dot)ted(dot)byers(at)rogers(dot)com> |
Subject: | Re: Problem creating stored procedure |
Date: | 2005-12-27 17:50:18 |
Message-ID: | 200512270950.18045.uwe@oss4u.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Try
CREATE FUNCTION .....
On Tuesday 27 December 2005 09:41, Ted Byers wrote:
> I am puzzled. Can ayone explain why I get an error from Postgres on this
> simple stored procedure?
>
> The following is from the pgAdmin III History window:
> -- Executing query:
> CREATE PROCEDURE addEntity (
> fn IN VARCHAR,
> ln IN VARCHAR,
> ivar IN VARCHAR,
> hi IN VARCHAR,
> pw IN VARCHAR,
> ea IN VARCHAR,
> ad IN VARCHAR,
> c IN VARCHAR,
> p IN VARCHAR,
> co IN VARCHAR,
> pc IN VARCHAR
> )
> AS
> DECLARE
> varID INTEGER
> BEGIN
> SELECT int varID uid from uids where email_address=ea;
> IF varID IS NOT NULL THEN
> INSERT INTO addy (uid,address,city,province,country,postal_code)
> VALUES (varID,ad,c,p,co,pc)
> ELSE
> INSERT INTO uids(family_name,first_name,initials,hid,pword,email_address)
> VALUES (ln,fn,ivar,hi,pw,ea)
> INSERT INTO addys(...) VALUES (currval('seq'),ad,c,p,co,pc)
> END IF;
> END
> LANGUAGE 'sql' VOLATILE;
>
> ERROR: syntax error at or near "PROCEDURE" at character 8
>
> Judging from the examples in the manual (around page 600), my procedure
> ought to be fine, but clearly Postgres doesn't like it.
>
>
> Thanks,
>
> Ted
>
>
> R.E. (Ted) Byers, Ph.D., Ed.D.
> R & D Decision Support Software
> http://www.randddecisionsupportsolutions.com/
--
UC
--
Open Source Solutions 4U, LLC 1618 Kelly St
Phone: +1 707 568 3056 Santa Rosa, CA 95401
Cell: +1 650 302 2405 United States
Fax: +1 707 568 6416
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2005-12-27 17:53:32 | Re: Problem creating stored procedure |
Previous Message | Ted Byers | 2005-12-27 17:41:44 | Problem creating stored procedure |