Re: Character translation?

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Linn Kubler" <lkubler(at)ecw2(dot)org>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Character translation?
Date: 2002-09-09 14:50:07
Message-ID: 200209091550.07630.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thursday 05 Sep 2002 11:15 pm, Linn Kubler wrote:
> Hi,
>
> I have a view like this:
> create view myview as
> select recid, title, firstname || chr(32) || lastname as expert, rank
> from mytable;
>
> When I use this view via odbc on a Windows 2000 system using Visual FoxPro
> the expert field shows up as a memo field. This is analogous to the text
> field in PSQL.
> What I'd like to do is have the expert column come through as a varchar
> type so that it shows up as a text field in VFP. Any suggestions?
> I was looking at the functions and didn't see anything that would do the
> trick for me but I could have just missed something. I also saw a
> reference to the cast() function but couldn't find any usage info on it in
> the online docs.

I think you're on the right track, try something like:

select (firstname || ' ' || lastname)::varchar as expert ...

If it works, could you let the list know in case anyone else needs this in
future. If not, there is an ODBC list too (see postgresql.org website for
details)

- Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2002-09-09 15:24:08 Re: Slow Multi-joins performance [DEVELOPERS attn please]
Previous Message Viacheslav N Tararin 2002-09-09 14:05:06 Re: Cross tables Like%