Dear Monks
Given the following snippet which adds a record into a simple Sqlite Database perfectly working
my $Tag1="hallo"; my $Tag2="bye"; my $dbh = DBI->connect( "dbi:SQLite:$DbFullPath", '', '', { sqlite_uni +code => 1 } ) || die "Cannot connect: $DBI::errstr"; $dbh->do('INSERT INTO Data (Tag1, Tag2) VALUES (?, ?)', undef, standardize($Tag1), standardize($Tag1)); $dbh->disconnect; sub standardize{ my $string=shift; #manipulating string $string=~ s/\'/\'\'/g; $string=~ s/^\s+|\s+$//g; $string=~ s/\t/ /g; return $string; }
Why is the following (updatin an entry) not working? (Error message "syntax error")
my $ID_read=1; my $dbh = DBI->connect( "dbi:SQLite:$DbFullPath", '', '', { sqlite_uni +code => 1 } ) || die "Cannot connect: $DBI::errstr"; $dbh->do ('UPDATE Data SET Tag1=?, Tag2=? WHERE ID=$ID_read VALUES (?, + ?)', undef, standardize($Tag1), standardize($Tag1)); $dbh->disconnect;
In reply to Update Sqlite References by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |