Re: converting an oracle procedure to postgres - Mailing list pgsql-sql

From Tom Lane
Subject Re: converting an oracle procedure to postgres
Date
Msg-id 16320.1066689135@sss.pgh.pa.us
Whole thread Raw
In response to converting an oracle procedure to postgres  ("Clint Stotesbery" <cstotes@hotmail.com>)
List pgsql-sql
"Clint Stotesbery" <cstotes@hotmail.com> writes:
> I know I have to relpace the word PROCEDURE with FUNCTION but then it wants 
> me to put RETURNS <datatype> but I don't want to return anything.

You can say RETURNS VOID in recent releases.  This is a bit of a hack
but it expresses your intent ... you still have to use SELECT to invoke
the function though.

regression=# create or replace function fooey () returns void as '
regression'# begin
regression'# raise notice ''fooey'';
regression'# return;
regression'# end' language plpgsql;
CREATE FUNCTION
regression=# select fooey();
NOTICE:  fooeyfooey
-------

(1 row)

regression=#

        regards, tom lane


pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: converting an oracle procedure to postgres
Next
From: "Clint Stotesbery"
Date:
Subject: assorted Postgres SQL/ORDBMS questions