I've searched around, and already "solved" the issue that is referenced in Tie::DBI question (re: case sensitivity in hash keys).

I thought I had the syntax down for using Tie::DBI for inserting data (which the perldoc does say is possible... but i must be missing something. i'm using:

my $parentId = $q->param('annual'); my $thisSession = $q->param('id'); tie my %obj, 'Tie::DBI', $dbh, 'conference_event','id', { CLOBBER = +> 1, WARN => 1, DEBUG => 1, CASESENSITIV => 1 } ; my @keys; if ( ! $thisSession ) { my $tempId = (keys %obj)[-1]; @keys = keys %{ $obj{$tempId} }; $thisSession = $tempId + 1; } else { @keys = keys %{ $obj{$thisSession} }; } my $newVals; foreach my $key ( @keys ) { $newVals->{$key} = $q->param($key) || $obj{$thisSession}->{$key}; } $newVals->{'id'} = $thisSession; $newVals->{'conf_annual_id'} = $parentId; ## $obj{$thisSession} = $newVals; $obj{'id'} = $newVals;
and it looks like the id is correct, and that something should be inserting, but when i look at my error_log:
Ignored attempt to change value of key field "id" at ... (line #) insert into table .... update table set ....

so i get both an insert and an update statement, but i don't get the row inserted into the DB ... i've sent the 'new' id to the errorlog, and it looks to be the right number ...

what am i missing?


In reply to Tie::DBI and inserts by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.