Thread: NULL DATE

NULL DATE

From
"Michel \\'ZioBudda\\' Morelli"
Date:
Hi, I have a item in a table that is a "date". I want to insert a null
value in this item. How can I make it ? Is it possible ?

A SI BIRU
--
Morelli 'ZioBudda' Davide Michel - Member of Pluto Linux User Group
michel@enter.it - http://ziobudda.enter.it/
Linux Problem? Ask to linux@media.dsi.unimi.it
"/dev/ziobudda: access to /var/tmp/beer denied, use /var/adm/pineapple"





Re: [SQL] NULL DATE

From
jwieck@debis.com (Jan Wieck)
Date:
>
> Hi, I have a item in a table that is a "date". I want to insert a null
> value in this item. How can I make it ? Is it possible ?

    CREATE TABLE mytab (a int4, b text, c date);

    -- attribute a will have NULL value
    INSERT INTO mytab (b, c) VALUES ('something', 'now');

    -- attribute b will have NULL value
    INSERT INTO mytab (a, c) VALUES (2, 'now');

    -- attribute c will have NULL value
    INSERT INTO mytab (a, b) VALUES (3, 'something else');


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

Re: [SQL] NULL DATE

From
ZioBudda
Date:
On Sun, 18 Oct 1998, Jan Wieck wrote:
>
>     -- attribute a will have NULL value
>     INSERT INTO mytab (b, c) VALUES ('something', 'now');

ok..
but i have the case
    INSERT INTO mytab (a,b,c) VALUES(2,'something','now');
    now i want to set NULL the date item in this tuple.

A SI BIRI
--
Italian Linux Meeting - http://www.pluto.linux.it/meeting/
--
Morelli 'ZioBudda' Davide Michel - Member of Pluto Linux User Group
michel@enter.it - http://ziobudda.enter.it/
Linux Problem? Ask to linux@media.dsi.unimi.it
"/dev/ziobudda: access to /var/tmp/beer denied, use /var/adm/pineapple"


Re: [SQL] NULL DATE

From
jwieck@debis.com (Jan Wieck)
Date:
>
> On Sun, 18 Oct 1998, Jan Wieck wrote:
> >
> >     -- attribute a will have NULL value
> >     INSERT INTO mytab (b, c) VALUES ('something', 'now');
>
> ok..
> but i have the case
>     INSERT INTO mytab (a,b,c) VALUES(2,'something','now');
>     now i want to set NULL the date item in this tuple.
>

    INSERT INTO mytab (a, b, c) VALUES (2, 'something', NULL);

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

RE: [SQL] NULL DATE

From
"Taral"
Date:
> ok..
> but i have the case
>     INSERT INTO mytab (a,b,c) VALUES(2,'something','now');
>     now i want to set NULL the date item in this tuple.

either:

INSERT INTO mytab (a,b) VALUES (2,''something');

or if it exists already:

UPDATE mytab SET c = NULL;

Taral