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 archives
  Advanced Search

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


  • From: Johan Nel <johan555(dot)nel555(at)xsinet555(dot)co(dot)za>
  • To: pgsql-general(at)postgresql(dot)org
  • Subject: Re: ERROR: syntax error at or near "IF"... why?
  • Date: Thu, 30 Apr 2009 09:12:47 +0200
  • Message-id: <gtbj2j$48n$1@news.eternal-september.org> <text/plain>

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;
                                           ^
-----------------------------------------------------------

For the if statement, i've tryed that
IF 2 = 2 THEN
 ROLLBACK;
END IF

but still the error near the "IF"..
dunno.. in mysql the if can be used in that way.. in postgres no?

Sorry was thinking FUNCTION way of doing it. DECLARE can only be used in a stored procedure/function.

Johan



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group