Gossamer Forum
Home : Products : Gossamer Links : Discussions :

add NULL value

Quote Reply
add NULL value
Hi,

I am trying to add a NULL value with

Code:
my $added = $DB->table('Links')->add($add);

And I donīt get it with:

Code:
$add->{Value} = undef;

there is '' in the Database

with

Code:
if ($value) {
$add->{Value} = $value;
}

there is '' in the Database

putting \NULL or NULL in the def file as default makes the DB value text 'NULL' or '\NULL'. I remember an issue with the condition and NULL but I could find nothing in the forum. Would be grateful for any hint.

Cheers

n||i||k||o

UPDATE:

O.K.: Post something and the solution comes.
right before the add statement I put:
Code:
$add->{Value} = \'NULL' unless $add->{Value};
I would have expected undef to work but it does not.

Last edited by:

el noe: May 23, 2014, 3:48 AM
Subject Author Views Date
Thread add NULL value el noe 2707 May 23, 2014, 3:00 AM
Post Re: [el noe] add NULL value
Andy 2583 May 23, 2014, 7:56 AM