Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: add NULL value: Edit Log

Here is the list of edits for this post
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

Edit Log: