My table is :
Attribute | Type | Modifier
empname | text |
salary | integer |
last_date | timestamp |
last_name | name |
My function and trigger is:
create function isFull()
returns opaque as '
select count(*) into tmp1 from emp;
if tmp1.count >= 5 then
select min(last_date) into tmp2 from emp;
delete from emp where last_date=tmp2.min;
drop table tmp2;
drop table tmp1;
create trigger isfull before insert on emp for each row execute procedure
But my error messages is :
ERROR: parser: parse error at or near "tmp1"
I can finish these steps in psql environment,why it could not work well in
plpgsql?Can you help me?
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
pgsql-interfaces by date
|Next:||From: Matthew H. North||Date: 2000-10-19 16:06:38|
|Subject: PsqlODBC on W2K conn. to PostgreSQL 7.0.2 on FreeBSD|
|Previous:||From: Scott Holmes||Date: 2000-10-18 16:54:25|
|Subject: Transactions and Errors with ODBC|