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:
and it looks like the id is correct, and that something should be inserting, but when i look at my error_log: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;
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |