Received: from s20.highertech.net (root@s20.highertech.net [209.54.120.20]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA20885 for ; Mon, 3 May 1999 13:36:24 -0400 (EDT) (envelope-from jt-kirkpatrick@mpsllc.com) Received: from kirkpatrickjt (whiteoak-34.highertech.net [209.140.56.34] (may be forged)) by s20.highertech.net (8.8.6/8.8.6) with SMTP id NAA15365; Mon, 3 May 1999 13:35:47 -0400 Received: by localhost with Microsoft MAPI; Mon, 3 May 1999 13:38:07 -0400 Message-ID: <01BE956A.2DADF600.jt-kirkpatrick@mpsllc.com> From: JT Kirkpatrick To: "'Herouth Maoz'" Cc: "'pgsql-sql@hub.org'" Subject: RE: [SQL] convert text to varchar Date: Mon, 3 May 1999 13:38:05 -0400 Organization: MPS, LLC X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit it tells me that the types aren't the same if i do this. well, now that i typed that i tried it again, and it worked. . . the first time i tried it, (the two tables have the same field names and types with the exception of this one field), i typed [insert into ap select * from ap3;] -- and it said that the types were not the same. but just now i typed [insert into ap (. . .all field names listed individually. . .) select {all field names listed individually in the same order} from ap3], and it worked. must be some limitation in the "select *" use. . . thanks very much! oh by the way, i haven't seen a camel in at least 12 years either! (except on that perl book -- or is that a llama?). i briefly looked at that site you recommended -- i think i could spend a while their later. -----Original Message----- From: Herouth Maoz [SMTP:herouth@oumail.openu.ac.il] Sent: Monday, May 03, 1999 12:02 PM To: JT Kirkpatrick; 'pgsql-sql@hub.org' Subject: Re: [SQL] convert text to varchar At 18:33 +0300 on 03/05/1999, JT Kirkpatrick wrote: > hi! i have a text field (table ap3, field name apnote) that i would like > to insert into a varchar field (same field name, table name ap). any idea > why this doesn't work? insert into ap (apnote) select varchar('apnote') > from ap3; -- it fails with or without the single quotes. Should be simply INSERT INTO ap (apnote) SELECT ap3.apnote FROM ap3; You really shouldn't have single quotes, and the conversion to text is supposed to be automatic. Herouth -- Herouth Maoz, Internet developer. Open University of Israel - Telem project http://telem.openu.ac.il/~herutma