Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: error in SELECT


  • From: Michael Fuhr <mike(at)fuhr(dot)org>
  • To: "P.M" <pmdanger(at)yahoo(dot)com>
  • Cc: "PostgreSQL General (EN)" <pgsql-general(at)postgresql(dot)org>
  • Subject: Re: error in SELECT
  • Date: Sat, 27 May 2006 09:49:24 -0600
  • Message-id: <20060527154923(dot)GA42745(at)winnie(dot)fuhr(dot)org>

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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group