Re: error in SELECT - Mailing list pgsql-general

From Michael Fuhr
Subject Re: error in SELECT
Date
Msg-id 20060527154923.GA42745@winnie.fuhr.org
Whole thread Raw
In response to error in SELECT  ("P.M" <pmdanger@yahoo.com>)
List pgsql-general
On Sat, May 27, 2006 at 08:20:47AM -0700, P.M wrote:
> i've just migrated a stored procedure from MySQl to PostgreSQL and i have the following error :
> ERROR:  syntax error at or near "SELECT" at character 371
>
> here is my function in PostgreSQL :
> CREATE OR REPLACE FUNCTION immense_sp001(VARCHAR,VARCHAR, service_nom VARCHAR, OUT result BOOLEAN, OUT error_message
VARCHAR)
> RETURNS record LANGUAGE plpgsql
> AS '
> BEGIN
>   DECLARE

BEGIN should follow the variable declarations.  See "Structure of
PL/pgSQL" in the documentation:

http://www.postgresql.org/docs/8.1/interactive/plpgsql-structure.html

The function also has other MySQLisms such as auto_increment and the
use of "set".  See the PL/pgSQL and other PostgreSQL documentation
for the appropriate syntax.

--
Michael Fuhr

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: error in SELECT
Next
From: "P.M"
Date:
Subject: Re: error in SELECT