From: Tom Lane <tgl@sss.pgh.pa.us>
To: Clint Stotesbery <cstotes@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: converting an oracle procedure to postgres
Date: Mon, 20 Oct 2003 18:32:15 -0400
Message-ID: <16320.1066689135@sss.pgh.pa.us> (raw)
In-Reply-To: <BAY9-F31GnRtU4RFuiP0001795c@hotmail.com>
References: <BAY9-F31GnRtU4RFuiP0001795c@hotmail.com>
"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: fooey
fooey
-------
(1 row)
regression=#
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, cstotes@hotmail.com
Subject: Re: converting an oracle procedure to postgres
In-Reply-To: <16320.1066689135@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox