X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3BF01D1B18A for ; Sat, 12 Jun 2004 19:55:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69689-05 for ; Sat, 12 Jun 2004 22:55:36 +0000 (GMT) Received: from albatross.mail.pas.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by svr1.postgresql.org (Postfix) with ESMTP id 106C4D1B16B for ; Sat, 12 Jun 2004 19:55:33 -0300 (ADT) Received: from 0-1pool116-89.nas15.indianapolis1.in.us.da.qwest.net ([65.128.116.89] helo=nick) by albatross.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 1BZHPQ-0000Dd-00; Sat, 12 Jun 2004 15:55:33 -0700 Reply-To: From: "Nick Fankhauser" To: "Simon Moses" , Subject: Re: Simon Moses Qs Date: Sat, 12 Jun 2004 17:56:25 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20040612135208.12853.qmail@web14923.mail.yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.4 tagged_above=0.0 required=5.0 tests=DEAR_SOMETHING, RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: * X-Archive-Number: 200406/46 X-Sequence-Number: 10248 Hi Simon- You have the JDBC list here. The SQL list might be a better place for future questions of this sort. Here's one way to do it: prod1=# create table testone (a boolean, b text); CREATE TABLE prod1=# insert into testone values ('t','true'); INSERT 485595194 1 prod1=# insert into testone values ('f','false'); INSERT 485595195 1 prod1=# select b || case when (a) then ' is true' else ' is false' end prod1-# from testone; ?column? ---------------- true is true false is false (2 rows) Regards, -Nick --------------------------------------------------------------------- Nick Fankhauser Business: nickf@doxpop.com Phone 1.765.965.7363 Fax 1.765.962.9788 doxpop - Court records at your fingertips - http://www.doxpop.com/ Personal: nick@fankhausers.com http://www.fankhausers.com -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Simon Moses Sent: Saturday, June 12, 2004 8:52 AM To: pgsql-jdbc@postgresql.org Subject: [JDBC] Simon Moses Qs dear sir, i am using postgresql 7.2. i want to concatenate 'character varying' and 'boolean' ex. select character_varying_field||boolean_field as new_field from table_name; or any function to convert 'boolean' to 'character varying' so that i can use select character_varying_field||convert_function(boolean_field) as new_field from table_name; thanks in advance simon moses. ********************************************************* Visit My Home Page updated: 20 June 2003. Simon Moses ********************************************************* Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger