Ignore previous half-completed email.

How do you get this to work in 7.2.1?

I'm creating a view of a table, but I'm trying to do something like
this:


create table t (
  id integer not null,
  amount numeric(7,2)
);

create view v as
  select id as v_id,
    'paid amount: ' || amount as v_comment
  from t
;

You get this:

ERROR:  Unable to identify an operator '||' for types 'unknown' and
'numeric'
        You will have to retype this query using an explicit cast

None of these work:

CAST(amount AS text)
CAST(amount AS varchar)
CAST(amount AS char)
and this:
CAST(amount AS real) works, but if amount is 12.00, then you just get '12' -
which is not cool.

Any ideas?

Chris


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to