Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karen Springer <karen.springer@xxxxxxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux