From: | Merrill Oveson <merrill(at)actarg(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | getting trigger to work |
Date: | 2002-03-19 15:46:54 |
Message-ID: | 3C975D6E.7C4F153D@actarg.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
This function & trigger work:
create function prosp_tf_bi() returns opaque as '
begin
if new.pros_id is null then
new.pros_id:= 1000;
end if;
return new;
end; ' language 'plpgsql';
create trigger prosp_tr_bi before insert on prospector
for each row execute procedure prosp_tf_bi();
This function & trigger don't work:
create function prosp_tf_bi() returns opaque as '
begin
if new.pros_id is null then
new.pros_id:= A1000;
end if;
return new;
end; ' language 'plpgsql';
create trigger prosp_tr_bi before insert on prospector
for each row execute procedure prosp_tf_bi();
The error is "Attribute 'a1000' not found"
The column pros_id is char(5).
How do I put in the 'A1000'?
From | Date | Subject | |
---|---|---|---|
Next Message | Doug McNaught | 2002-03-19 15:53:38 | Re: Reference pg_user ? |
Previous Message | Oberpriller, Wade D. | 2002-03-19 15:42:57 | Visual display tool? |