Should be able to do it with the RETURNS clause:
CREATE PROCEDURE MyProc(IN :Val1 INTEGER,IN :Val2 INTEGER,
IN :Val3 INTEGER)
RETURNS(ID INTEGER);
BEGIN
SELECT Val1 + Val2 + Val3;
END;#
More cleanly, PSQLv9 has support for User-Defined Functions, which is
actually what you want.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 03/2007 ***
k.andris (AT) gmail (DOT) com wrote:
Quote:
Hello Folks!
How do I create a stored procedure, which returns a singel integer
value? I need to use the procedure in the following way:
SELECT name, age, myproc(age, height, weight) FROM people
the result would be a list of names, ages, and a value for each
calculated by myproc.
Is it possible with Pervasive 9?
Thanks.
A. |