more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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? -- In reply to Re^2: How to insert a NULL value into a table!!
by misterwhipple
|
|