Re: getting trigger to work

From: Antonio Sergio de Mello e Souza <asergioz(at)bol(dot)com(dot)br>
To: Merrill Oveson <merrill(at)actarg(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: getting trigger to work
Date: 2002-03-19 16:50:21
Message-ID: 3C976C4D.9010603@bol.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Merrill Oveson wrote:

>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';
>
>
>The error is "Attribute 'a1000' not found"
>
>The column pros_id is char(5).
>How do I put in the 'A1000'?
>
Hi,

You need to surround the new value with two pairs of quotation marks,
like this:

''A1000''

Regards,

Antonio Sergio

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-03-19 17:14:24 Re: getting trigger to work
Previous Message Andrew Sullivan 2002-03-19 16:26:02 Re: locking problems