Re: Need help creating a stored procedure - Mailing list pgsql-novice

From John DeSoi
Subject Re: Need help creating a stored procedure
Date
Msg-id C4D6FC71-767C-11D9-A4FB-000A95B03262@pgedit.com
Whole thread Raw
In response to Need help creating a stored procedure  ("T- Bone" <jbowen333@hotmail.com>)
List pgsql-novice
On Feb 3, 2005, at 6:31 PM, T- Bone wrote:

> CREATE OR REPLACE FUNCTION "MySchema".tester(int8)
>  RETURNS SETOF "MySchema"."tblTransact" AS
> 'DECLARE
>   rec RECORD;
> BEGIN
>   FOR rec IN SELECT * FROM "MySchema"."tblTransact"
>   WHERE "OfferID" > $1
>   LOOP
>      RETURN NEXT rec;
>   END LOOP;
>   RETURN;
> END;'
>  LANGUAGE 'plpgsql' VOLATILE;
>


Since you are returning a specific table type, try changing the rec
declaration line to:

rec "MySchema"."tblTransact"%rowtype;



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-novice by date:

Previous
From: John DeSoi
Date:
Subject: Re: Installation tool
Next
From: SG Edwards
Date:
Subject: perl script for uniprot