On Tuesday 13 January 2004 01:39, Thapliyal, Deepak wrote:
> Now my function is created ... Thanks guys ..
>
> Now getting error while trying to execute it
>
> postgres=# select loadme();
> WARNING: Error occurred while executing PL/pgSQL function loadme
> WARNING: line 7 at SQL statement
> ERROR: SPI_prepare() failed on "commit"
Remove the "commit" line - functions cannot define their own transactions
anyway. I guess you're being misled by the "begin" line - it's matched by the
"end" and defines the function body rather than any transaction.
--
Richard Huxton
Archonet Ltd