X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 161B95E4710 for ; Wed, 1 Sep 2004 17:27:29 -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 66540-04 for ; Wed, 1 Sep 2004 20:27:20 +0000 (GMT) Received: from gate1.opus.co.nz (gate1b.opus.co.nz [202.135.231.101]) by svr1.postgresql.org (Postfix) with ESMTP id F15E05E4708 for ; Wed, 1 Sep 2004 17:27:18 -0300 (ADT) Received: from chsv01.opus.co.nz ([151.135.36.1]) by gate1.opus.co.nz with esmtp (Exim 4.41) id 1C2bhL-00044r-Sz for pgsql-sql@postgresql.org; Thu, 02 Sep 2004 08:27:15 +1200 Received: from chpc098.opus.co.nz ([151.135.39.157] helo=CHPC098) by chsv01.opus.co.nz with smtp (Exim 4.41) id 1C2bhL-0005ZE-Hv for pgsql-sql@postgresql.org; Thu, 02 Sep 2004 08:27:15 +1200 From: "Traci Sumpter" To: Subject: Defining Field Types with view Date: Thu, 2 Sep 2004 08:27:14 +1200 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.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Opus-MailScanner-Information: Please contact grtecz for more information X-Opus-MailScanner: Found to be clean X-Opus-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-4.9, required 5, autolearn=not spam, BAYES_00 -4.90) X-MailScanner-From: traci.sumpter@opus.co.nz X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/22 X-Sequence-Number: 18868 Cheesy one here.... I created a view similar to Select field1, field2 from table where field3 = 'Fred' UNION Select field1, field2 from table where field3 = 'Wilma'; When the view contains just one sql statement the field definitions e.g. charater varying (20) however when both are in the fields turn into character varying (no size). this is causing a problem when referring to the fields within Dephi/VB because they think the varchar fields are memo. I have got around it by creating another view which selects field1::varchar(100) , field2 varchar(50) from firstview. I have tried casting the fields within the first view but to no sucess. Any way to get over this??? Cheers