On Sun, 25 Oct 2009 20:17:22 -0400, Tom Lane wrote about Re: [GENERAL]
Can the string literal syntax for function definitions please be
dropped ?:

[snip]
>         <routine body> ::=
>                <SQL routine body>
>              | <external body reference>
>
>         <SQL routine body> ::= <SQL procedure statement>
>
>and <SQL procedure statement> seems to allow one (count em, one) SQL
>DDL or DML statement.  So per spec, essentially every interesting case
>requires an <external body reference>.

This explains the evolution of DB2's support for user-defined
functions: initially they (UDFs) had to be written in some host language
(COBOL, PL/I, C, etc.), and linked in by external reference; later, a
single SQL statement(*) was permitted instead; finally, a compound SQL
statement was permitted, with BEGIN and END bracketing an arbitrary
collection of other SQL statements.

(*) Since all UDFs must return a value, the single statement was
almost invariably a RETURN with some query providing the value.
-- 
Regards,

Dave  [RLU #314465]
=======================================================================
david.w.n...@ntlworld.com (David W Noon)
=======================================================================

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to