X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CA47D9FA5EA for ; Wed, 31 May 2006 22:13:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 04181-08 for ; Wed, 31 May 2006 22:12:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from iplocks.co.jp (iplocks.co.jp [211.19.47.137]) by postgresql.org (Postfix) with SMTP id CC73F9FA621 for ; Wed, 31 May 2006 22:12:56 -0300 (ADT) Received: (qmail 12339 invoked from network); 1 Jun 2006 10:12:53 +0900 Received: from unknown (HELO ebihara) (216.132.219.66) by iplocks.co.jp with SMTP; 1 Jun 2006 10:12:53 +0900 From: "EBIHARA, Yuichiro" To: Subject: Re: Fields Date: Thu, 1 Jun 2006 10:14:22 +0900 Message-ID: <001901c68518$b7cd6b40$360aa8c0@ipljp.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 In-Reply-To: <1149108973.20798.3.camel@archimedes> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/152 X-Sequence-Number: 15280 Hi, Another solution may be a view as follows. create table orders (a int, b int); create view orders_v as select a, b, a * b as c from orders; ebi > -----Original Message----- > From: pgsql-jdbc-owner@postgresql.org > [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Mark Lewis > Sent: Thursday, June 01, 2006 5:56 AM > To: Guy Rouillier > Cc: pgsql-jdbc@postgresql.org > Subject: Re: [JDBC] Fields > > > On Wed, 2006-05-31 at 15:51 -0500, Guy Rouillier wrote: > > Charles Curi wrote: > > > Hi people!!! > > > I have a table called "orders" with fields "a","b" and > "c". I want > > > to make a INSERT only of fields "a" and "b" by Java and at this > > > moment c=a*b; Is it possible? > > > > I think you are saying you want your Java code to insert fields "a" > > and "b" and have "c" automatically set to a value derived > from "a" and > > "b". If so, you can accomplish this with an insert trigger. > > > > Or you could just insert a, b and a*b yourself . . . . or am > I missing something here? > > -- Mark > > ---------------------------(end of > broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > > >