in reply to Re: DBI and Hash
in thread DBI and Hash

Well I feel dumb, I went and re-ran the code to get the error to paste here and didn't get an error. Now I need to go figure out why. Should have pasted it here the first time.

Replies are listed 'Best First'.
Re^3: DBI and Hash
by Anonymous Monk on Feb 14, 2012 at 08:57 UTC

    Just for what it's worth, the default value for an inserted row is a NULL value. (Unless overridden, so I guess I should have said "default default value.") Assume a table named test of columns foo, bar, baz:

    INSERT INTO test (foo, bar) VALUES('fred', 'barney');

    Now, the column baz should be NULL. In other words, if you want to insert a NULL into a database, you can just omit it from the list of columns.

    BTW, your foreach sets the numeric value zero and the empty string to NULL, too. I doubt you want that. You should be using unless exists $sqlinsert{$temp} instead.

    Oh, and dummy values suck.