Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 41675 invoked from network); 3 Mar 2005 16:27:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Mar 2005 16:27:44 -0000 Received: (qmail 19980 invoked by uid 500); 3 Mar 2005 16:27:43 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 19951 invoked by uid 500); 3 Mar 2005 16:27:43 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 19936 invoked by uid 99); 3 Mar 2005 16:27:43 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_60_70,HTML_MESSAGE,HTML_TITLE_EMPTY X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp05.wanadoo.nl (HELO smtp05.wanadoo.nl) (194.134.35.145) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 08:27:41 -0800 Received: from DB35TT0J (c53755738.cable.wanadoo.nl [83.117.87.56]) by smtp5.wanadoo.nl (Postfix) with SMTP id A65CF34FB1 for ; Thu, 3 Mar 2005 17:27:01 +0100 (CET) Message-ID: <000d01c5200d$ea40dbf0$38577553@DB35TT0J> From: "Piet Blok" To: "Derby Discussion" References: <000601c51c09$8a725800$38577553@DB35TT0J> <4226500C.9000005@gmail.com> Subject: Re: DATE manipulation Date: Thu, 3 Mar 2005 17:27:38 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01C52016.4BEB2C40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C52016.4BEB2C40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thank you for the pointer Stanley, I should ofcourse have looked there = in the first place. I read it now and I think it does not look too = complicated. Piet Blok ----- Original Message -----=20 From: Stanley Bradbury=20 To: Derby Discussion=20 Sent: Thursday, March 03, 2005 12:45 AM Subject: Re: DATE manipulation Hi - See the section "How do I perform date arithmetic in = Derby/Cloudscape?" in the FAQ document at: = http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0408brad= bury/ Once an addMonth function is created and defined in the DB as = described in the FAQ it can be referenced in a column default. Piet Blok wrote:=20 Since I am not an expert on databases I am just experimenting a bit = in which Derby comes in very handy. I am trying to create a table and set a default value for one of the = columns that should be one month from now, like this: Plan_Date Date NOT NULL DEFAULT CURRENT_DATE + 1 MONTH, This is not accepted. I got the idea from a site on DB2 (I hoped DB2 = and Derby share the same features) = http://www-106.ibm.com/developerworks/db2/library/techarticle/0211yip/021= 1yip3.html Is there any other way to default to a month from now? Piet Blok ------=_NextPart_000_000A_01C52016.4BEB2C40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thank you for the pointer Stanley, = I should=20 ofcourse have looked there in the first place. I read it = now and I=20 think it does not look too complicated.
 
 
Piet Blok
----- Original Message -----
From:=20 Stanley=20 Bradbury
Sent: Thursday, March 03, 2005 = 12:45=20 AM
Subject: Re: DATE = manipulation

Hi -
See the section "How do I perform date = arithmetic in=20 Derby/Cloudscape?"  in the FAQ document at:
http://www-128.ibm.com/developerworks/db2/library/techarti= cle/dm-0408bradbury/

Once=20 an addMonth function is created and defined in the DB as = described in=20 the FAQ it can be referenced in a column default.

Piet Blok = wrote:=20
Since I am not an expert on = databases I am=20 just experimenting a bit in which Derby comes in very=20 handy.
 
I am trying to create a table and = set a default=20 value for one of the columns that should be one month from now, = like=20 this:

Plan_Date Date NOT NULL DEFAULT CURRENT_DATE + 1=20 MONTH,

This is not accepted. I got the = idea from a=20 site on DB2 (I hoped DB2 and Derby share the same features) http://www-106.ibm.com/developerworks/db2/library/tec= harticle/0211yip/0211yip3.html
 
Is there any other way to default = to a month=20 from now?
 
Piet=20 Blok

------=_NextPart_000_000A_01C52016.4BEB2C40--