Search Postgresql Archives

Re: ERROR: syntax error at or near "IF"... why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/04/2009 07:45, DaNieL..! wrote:

> I tryed the declare, before and after the BEGIN;, but allways returns
> me the error:
> -----------------------------------------------------------
> ERROR: syntax error at or near "int";
> LINE 1: DECLARE _mycredit int;
>                                            ^
> -----------------------------------------------------------

I missed what came before in this thread, but in plpgsql functions the
DECLARE comes before BEGIN:

  create or replace function my_function() returns....
  as
  $$
  declare
    ....
  begin
    ....
    return....
  end;
  $$
  language plpgsql;

Can you show us the full function code again please?

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@xxxxxx
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux