Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

cannot set columns to NULL in GT::SQL::Table->update

Quote Reply
cannot set columns to NULL in GT::SQL::Table->update
Hi,

Does anyone have an idea why the following code does not set the column slip_id to NULL for all records where slip_id is equal to 7?
Code:

my $trans = $DB->table( "transactions" );
$trans->update( {'slip_id'=>undef}, GT::SQL::Condition->new('slip_id', '=', 7 ) );
Note that the following code does work:
Code:
my $trans = $DB->table( "transactions" );
$trans->update( {'slip_id'=>0}, GT::SQL::Condition->new('slip_id', '=', 7 ) );

Thanks, Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] cannot set columns to NULL in GT::SQL::Table->update In reply to
A wild guess:

$trans->update( { slip_id => \'NULL' }, { slip_id => 7 } );

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] cannot set columns to NULL in GT::SQL::Table->update In reply to
It works! Thanks for the guess. Cool

http://www.bookings.org