Re: View fields are cast as text and link to Access as a Memo field

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: View fields are cast as text and link to Access as a Memo field
Дата
Msg-id 28912.1201653995@sss.pgh.pa.us
обсуждение исходный текст
Ответ на View fields are cast as text and link to Access as a Memo field  (Karen Springer <karen.springer@wulfsberg.com>)
Список pgsql-general
Karen Springer <karen.springer@wulfsberg.com> writes:
> I need employeeName to be a text field in Access.  I have tried casting
> the fields in the view as varchar, but it seem to default back to ::text.

The result of a || operator is always going to be type text.  Put the
cast around the whole expression, not just the individual fields.
For instance,

        CASE
            WHEN "Participant_Names"."NameUsed" IS NULL THEN
("Participant_Names"."LastNAME" || ', ') || "Participant_Names"."FirstName"
            ELSE ("Participant_Names"."LastNAME" || ', ') || "Participant_Names"."NameUsed"
        END :: varchar AS "employeeName"

            regards, tom lane

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

Предыдущее
От: Karen Springer
Дата:
Сообщение: View fields are cast as text and link to Access as a Memo field
Следующее
От: "Selena Deckelmann"
Дата:
Сообщение: Re: PGCon vs Postgresql Conference