Thread: Calling void functions
I'm informed that the last statement of a function that returns void cannot be a SELECT. How else is one supposed to call another function which also returns void? E.g., CREATE FUNCTION foo (a int, b int) RETURNS voidLANGUAGE plpgsqlAS $$ do important things $$; CREATE FUNCTION foo (a int) RETURNS voidLANGUAGE sqlAS $$ SELECT foo($1, default-value); $$; -- Peter Eisentraut http://developer.postgresql.org/~petere/
> I'm informed that the last statement of a function that returns void > cannot be > a SELECT. How else is one supposed to call another function which also > returns void? > PERFORM
am Mon, dem 02.04.2007, um 8:52:09 -0400 mailte Daniel Caune folgendes: > > I'm informed that the last statement of a function that returns void > > cannot be > > a SELECT. How else is one supposed to call another function which > also > > returns void? > > > > PERFORM PERFORM works only in plpgsql, Peter wrote a pl/sql-function... Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
Peter Eisentraut <peter_e@gmx.net> writes: > I'm informed that the last statement of a function that returns void cannot be > a SELECT. How else is one supposed to call another function which also > returns void? Hmm, seems like the best answer is to rejigger the order of the tests in check_sql_fn_retval. I think that logic was designed before we had an idea of VOID-returning functions. regards, tom lane
> PERFORM works only in plpgsql, Peter wrote a pl/sql-function... > Oups, sorry! I missed the point.