pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Character translation?
4+ messages / 4 participants
[nested] [flat]

* Character translation?
@ 2002-09-05 22:15  Linn Kubler <lkubler@ecw2.org>
  0 siblings, 2 replies; 4+ messages in thread

From: Linn Kubler @ 2002-09-05 22:15 UTC (permalink / raw)
  To: pgsql-sql

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.

Any help is greatly appreciated.
Thanks in advance,
Linn


--
Please remove the number two from domain name for email.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Character translation?
@ 2002-09-09 07:47  Troy <tjk@tksoft.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Troy @ 2002-09-09 07:47 UTC (permalink / raw)
  To: lkubler@ecw2.org; +Cc: pgsql-sql

Would this work?

select recid, title, firstname || chr(32) || lastname::char(50) as expert, 
	rank from mytable where length(lastname) <= 50;



Troy

> 
> 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.
> 
> Any help is greatly appreciated.
> Thanks in advance,
> Linn
> 
> 
> --
> Please remove the number two from domain name for email.
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
> 




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Character translation?
@ 2002-09-09 14:50  Richard Huxton <dev@archonet.com>
  parent: Linn Kubler <lkubler@ecw2.org>
  1 sibling, 0 replies; 4+ messages in thread

From: Richard Huxton @ 2002-09-09 14:50 UTC (permalink / raw)
  To: Linn Kubler <lkubler@ecw2.org>; 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Character translation?
@ 2002-09-09 15:37  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Linn Kubler <lkubler@ecw2.org>
  1 sibling, 0 replies; 4+ messages in thread

From: Stephan Szabo @ 2002-09-09 15:37 UTC (permalink / raw)
  To: Linn Kubler <lkubler@ecw2.org>; +Cc: pgsql-sql


On Thu, 5 Sep 2002, 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.

cast() isn't a function precisely speaking.  It works as
CAST(expr as datatype).





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-09-09 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 22:15 Character translation? Linn Kubler <lkubler@ecw2.org>
2002-09-09 14:50 ` Richard Huxton <dev@archonet.com>
2002-09-09 15:37 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-09-09 07:47 Re: Character translation? Troy <tjk@tksoft.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox