Re: Need help creating a stored procedure

From: John DeSoi <desoi(at)pgedit(dot)com>
To: "T- Bone" <jbowen333(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Need help creating a stored procedure
Date: 2005-02-04 07:17:03
Message-ID: C4D6FC71-767C-11D9-A4FB-000A95B03262@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Teddy 2005-02-04 08:48:14 Borland C++
Previous Message John DeSoi 2005-02-04 07:02:19 Re: Installation tool