in reply to Re: How to insert a NULL value into a table!!
in thread How to insert a NULL value into a table!!
I believe keszler is correct: you will not be able to insert NULL with the undef mechanism using an interpolated string. You can try setting $Ids->{Cluster} using a string literal;
$Ids->{Cluster} = 'NULL'but string interpolation in general is iffy for writing a SQL query. It is better to use bound parameters: they're easier to get right, and they're safer, security-wise. See DBI->bind_param() for an explanation and example.
There are other problems, however. You have not shown how $dc_id and $cluster_id acquire their values. Are you completely certain they're set to what you think they are?
Also, the table definition for Hosts.Cluster_ID does not explicitly say the column is nullable. Are you completely certain of the default?
--
Your left-hand veeblefetzer is calibrated to the wrong Frammistan coefficient. Pass me that finklegruber.
|
|---|