Re: converting an oracle procedure to postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Clint Stotesbery" <cstotes(at)hotmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: converting an oracle procedure to postgres
Date: 2003-10-20 22:32:15
Message-ID: 16320.1066689135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Clint Stotesbery" <cstotes(at)hotmail(dot)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: fooey
fooey
-------

(1 row)

regression=#

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Clint Stotesbery 2003-10-21 01:40:11 assorted Postgres SQL/ORDBMS questions
Previous Message Josh Berkus 2003-10-20 21:28:24 Re: converting an oracle procedure to postgres