Re: Parse error help needed...

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Thapliyal, Deepak" <dthapliyal(at)soe(dot)sony(dot)com>, "'Larry Rosenman'" <ler(at)lerctr(dot)org>, "'PostgreSQL General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Parse error help needed...
Date: 2004-01-13 11:42:44
Message-ID: 200401131142.44354.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anton.Nikiforov 2004-01-13 11:48:07 Re: insertion with trigger failed unexpectedly
Previous Message Richard Huxton 2004-01-13 11:38:51 Re: sql insert function