Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>Scott Marlowe <[EMAIL PROTECTED]> wrote on 08/07/2006 12:18:17 PM: > > Just FYI, text and varchar are, internally, pretty much the same types. > varchar has an optional precision setting as in varchar(200) while text > does not allow one. > > All the text ops are written for text types, so varc

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>"Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote on 08/07/2006 11:30:28 AM: > Well, you cast all those fields to be concatenated to text. Why should the db > make a varchar out of that? I seriously doubt that 7.x made a varchar of that > - but then, 7.2 is very very old. > So either cast your field

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
"Uwe C. Schroeder" <[EMAIL PROTECTED]> wrote on 08/07/2006 11:30:28 AM: > Well, you cast all those fields to be concatenated to text. Why should the db > make a varchar out of that? I seriously doubt that 7.x made a varchar of that > - but then, 7.2 is very very old. > So either cast your field

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
Rodrigo Gonzalez <[EMAIL PROTECTED]> wrote on 08/07/2006 11:41:52 AM: > SELECT b.ltname, ((c.refullname::text || d.enname::text) || > f.evname::text)::varchar AS evlinkname1, > This worked, thank you. *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** Margaret Gill

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread MargaretGillon
>Rodrigo Gonzalez <[EMAIL PROTECTED]> wrote on 08/07/2006 11:36:28 AM: > Really, I dont see the 3 varchar fields concatenated to a new field. > > But do this > > (varchar1||varchar2||varchar3||newfield)::varchar > > Best regards > This is the concatenate statement > > SELECT b.ltname, (c

Re: [GENERAL] Varchar concatenate fields as Char or Varchar, not Text

2006-08-07 Thread Uwe C. Schroeder
Well, you cast all those fields to be concatenated to text. Why should the db make a varchar out of that? I seriously doubt that 7.x made a varchar of that - but then, 7.2 is very very old. So either cast your fields to varchar (i.e. c.refullname::varchar || d.enname::varchar) or cast the result