[Catalyst] Null values in DBIx::Class

Hermida, Leandro Leandro.Hermida at fmi.ch
Thu Nov 23 16:32:47 GMT 2006


> I have set up MYAPPDB::TestTable with the unique key
test_table_column2.
> Now in my controller I do that:
> 
> $->model(MYAPPDB::TestTable)->update_or_create({
>    'column1' => $value1,
>    'column2' => $value2
> }, {key => 'test_table_column2'}
> );

Do this:

$->model(MYAPPDB::TestTable)->update_or_create({
    'column1' => undef,
    'column2' => $value2
 }, {key => 'test_table_column2'}
);

> I tried with $value1 = 'NULL', $value1 = '' or undef $value1, but none

> of them worked.

undef $value1  puts $value1 into an uninitialized state.  Maybe you
meant $value1 = undef;


Leandro Hermida




More information about the Catalyst mailing list