Re: Concatenated VARCHAR becomes TEXT in view

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Concatenated VARCHAR becomes TEXT in view
Дата
Msg-id 20060201190050.GB9888@svana.org
обсуждение исходный текст
Ответ на Concatenated VARCHAR becomes TEXT in view  (MargaretGillon@chromalloy.com)
Ответы Re: Concatenated VARCHAR becomes TEXT in view  (MargaretGillon@chromalloy.com)
Список pgsql-general
On Wed, Feb 01, 2006 at 08:44:01AM -0800, MargaretGillon@chromalloy.com wrote:
> I have a view which I use to populate list boxes on several input screens
> in Visual FoxPro for Windows. In the view I concatenate three varchar
> columns to make a new column. The concatenation works fine but the
> resulting column is a text column, which becomes a memo field in Visual
> FoxPro. Memos don't work well for list boxes. Is there any way to get the
> resulting column as a varchar or char field? My view command is below. I
> have tried changing the ::text to ::varchar but the outcome is the same.

It's not clear from your query which ::text you converted to ::varchar,
but what you need to do is cast the result, not the arguments. The
result of btrim() is also of type text so you're actually concatinating
three text strings. You need to put (blah)::varchar around everything.

Alternativly (what I generally do) is change the ODBC settings so that
text doesn't map to memo but to a normal string. That fixes it for
me. IIRC there's a setting "Text as memo field" which you untick.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Jim Rosenberg
Дата:
Сообщение: Building html documentation
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Best way to handle table trigger on update