ScOut3R has asked for the wisdom of the Perl Monks concerning the following question:
I have problems with the @values array, because the $db->do function wont split it into separate values. Is there a good way to separate it automatically? I'd like to insert full rows, so i'll pass as many values to this function as many columns are in the table. Thank You for your help!sub insert_element { my $table = pop @_; my @values = @_; $db->do("insert into '$table' values ('@values')") or my $error = +$db->errstr; if (defined($error)) { die syslog('info',"insert: $error +"); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI Sqlite insert function
by olus (Curate) on Jun 30, 2008 at 18:03 UTC | |
by ScOut3R (Sexton) on Jul 01, 2008 at 13:57 UTC | |
by olus (Curate) on Jul 01, 2008 at 15:24 UTC | |
by ScOut3R (Sexton) on Jul 01, 2008 at 16:31 UTC |