stored procedures in postgresql user plpgsql

From: RobertD(dot)Stewart(at)ky(dot)gov
To: pgsql-sql(at)postgresql(dot)org
Subject: stored procedures in postgresql user plpgsql
Date: 2004-11-29 18:37:42
Message-ID: 06AF099D94D33B4D9120504521D6539D0F47CD96@agency33.state.ky.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I know that there are not stored procedures like that in oracle. I know that
you have to create functions.

I have tried to create a simple function to select data from a table. Could
you all please correct me

Thanks

CREATE FUNCTION retrive_atype(varchar) RETURNS varchar AS '

BEGIN

RETURN select username from masteraccount where atype=$1;

END;

' LANGUAGE 'plpgsql';

To call the function I used

Select retrive_atype();

Please help

Robert Stewart

Network Eng

Commonwealth Office of Technology

Finance and Administration Cabinet

101 Cold Harbor

Work # 502 564 9696

Cell # 502 330 5991

Email RobertD(dot)Stewart(at)ky(dot)gov <mailto:RobertD(dot)Stewart(at)ky(dot)gov>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Travers 2004-11-29 19:13:15 Re: Way to stop recursion?
Previous Message sreejith s 2004-11-29 17:01:33 Crystal Report + Bytea field