in reply to Update Sqlite References

I guess the problem was in WHERE ID=$ID_read. Using the following is okay:

my $sth = $dbh->prepare( 'update Data set Tag1=?, Tag2=? where ID=?' ); $sth->execute(StandardizeString($Tag1),StandardizeString($Tag2), $ID +_read);

Replies are listed 'Best First'.
Re^2: Update Sqlite References
by NetWallah (Canon) on Jan 06, 2017 at 05:37 UTC
    Yes - the reason your original code:
    $dbh->do ('UPDATE Data SET Tag1=?, Tag2=? WHERE ID=$ID_read VALUES (?, + ?)',
    did not work is that $ID will NOT get interpolated, since the string is in single quotes.

    It could be fixed by:

    $dbh->do ("UPDATE Data SET Tag1=?, Tag2=? WHERE ID=$ID_read VALUES (?, + ?)", # = + =

            ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall