Can't save edited values to database

From: Nancy McMullin (NANCY.MCMULLIN_at_DFAS.MIL)
Date: 02/18/05


Date: Fri, 18 Feb 2005 09:21:27 -0700
To: <dbi-users@perl.org>

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!



Relevant Pages

  • Re: Cant save edited values to database
    ... HTH, ... > I'm attempting an edit screen in Perl with Oracle. ... > writing out the old values - not the new changes. ...
    (perl.dbi.users)
  • Re: Is it possible to change dbname?
    ... I just get so many issues when writing ... code (perl and php) that connects to oracle. ...
    (comp.databases.oracle.server)
  • Re: ANNOUNCE: DBD:Oracle 1.18
    ... Well a warning in one compiler is better than and error in an other so I ... This might be a problem more with the older oracle OCI in your client. ... perl -Mblib t/26exe_array.t ...
    (perl.dbi.users)
  • Re: DBD Oracle 1.20 ORA-24334 Error
    ... On the premise instant client and also tried to run perl Makefile.PL -V ... the status after having connected to Oracle ... Failed 2/33 tests, 93.94% okay ...
    (perl.dbi.users)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... If you want to store high precision numbers in oracle, you've got 38 decimal digits to play with, and with minimal coaxing perl will handle them as strings at the appropriate points so that the exact values go in and come out. ... I haven't done any numerical work in 10 years or so, but I seem to recall that one can reasonably expect 6 or so decimal significant digits from a 32 bit floating point number - I'll go out on a limb and hazard that one can expect 12 or so digits from a 64 bit floating point number - at any rate I'd be very surprised to get 18 significant digits. ...
    (perl.dbi.users)