Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Assign (null)-value

0 views
Skip to first unread message

Matthijs Willemstein

unread,
Dec 13, 1998, 3:00:00 AM12/13/98
to
Hello All,

I'm using SQL-Server 6.5. In a table I've defined a foreign key on a field
which can be null. So if the user wants to break this relationship, I have
to enter a (null) value.
Maybe it is just me but i cannot find anything on giving a certain DB-field
the value : (Null).

thanks in advance,

Matthijs
--
======
please check mail-adress if replying by mail. I try to avoid SPAM.


Steve Koterski

unread,
Dec 14, 1998, 3:00:00 AM12/14/98
to
On Sun, 13 Dec 1998 17:26:30 +0100, "Matthijs Willemstein"
<m...@willemstein.binele.notthis.nl> wrote:

>I'm using SQL-Server 6.5. In a table I've defined a foreign key on a field
>which can be null. So if the user wants to break this relationship, I have
>to enter a (null) value.
>Maybe it is just me but i cannot find anything on giving a certain DB-field
>the value : (Null).

Using methods of the VCL, call the TField.Clear method.

Query1.FieldByName('KeyField').Clear;

Using SQL, execute an UPDATE statement. In the SET clause, assign the
target column a value of NULL.

UPDATE YourTable
SET KeyField = NULL
WHERE (KeyField = "SomeValue")

//////////////////////////////////////////////////////////////////////////
Steve Koterski "The knowledge of the world is only to
Technical Publications be acquired in the world, and not in a
INPRISE Corporation closet."
http://www.inprise.com/delphi -- Earl of Chesterfield (1694-1773)

0 new messages