Hi Nancy,

Shouldn't your prepare statement be: 

   my $sth = .... WHERE t1 = '$pt'") or die ...

Instead of 

   my $sth = .... WHERE t = '$pt'") or die ... 

HTH,
K.C

On Fri, 18 Feb 2005 09:21:27 -0700, MCMULLIN, NANCY
<[EMAIL PROTECTED]> wrote:
> I'm attempting an edit screen in Perl with Oracle.  I'm unable to figure
> out how to keep the changed values so I can write to the DB.   Can
> anyone help?  Here's part of my code:
> 
> ===================
> ....
> my $pt  = param('t1');  # value retrieved from page before
> ...
> my $dbh = DBI->connect("DBI:Oracle:sid", "uid", "pw",{AutoCommit=>1});
> 
> ($pnotes) = $dbh->selectrow_array("SELECT notes FROM table WHERE t1 =
> '$pt'");
> ...
> Print "<form>";
> print "<input type=text value=\"$pnotes\" name=notes>\n"; #user enters
> new value here
> print "<input type=submit name=edit value=' SAVE CHANGES '>\n"; # don't
> know what to use to actually start the update statement below...
> print "</form>\n";
> my $notes = $pnotes;
> my $sth = $dbh1->prepare("UPDATE table SET notes='$notes' WHERE t =
> '$pt'") or die "Preparing: ", $dbh->errstr;
> $sth->execute or die "Executing: ", $sth->errstr;  # this is just
> writing out the old values - not the new changes.
> ...
> ===================
> 
> Thanks!
>

Reply via email to