Re: the Database is not updated

2007-06-21 Thread Dr.Ruud
Aruna Goke schreef: Missing: #!/usr/bin/perl use strict; use warnings; > open FH, '<', $fn or die "The File $fn Could not be opened: $! \n"; > while() > { > #split the file into variables It is not about the file but about the (or each) row. Maybe something more like: # each row con

RE: the Database is not updated

2007-06-21 Thread Andrew Curry
Do you check for the number of rows updated? An update will not throw an error even if no rows are updated, have you tried your values by hand? -Original Message- From: Aruna Goke [mailto:[EMAIL PROTECTED] Sent: 20 June 2007 19:33 To: beginners@perl.org Subject: the Database is not upda

Re: the Database is not updated

2007-06-20 Thread Aruna Goke
Chas Owens wrote: On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote: snip This might not be necessary for the RDMS you use, but I generally end my database-driven scripts with this block: END { if ($?) { print "Exiting with error, rolling back data!\n"; $dbh->rollback(); }

Re: the Database is not updated

2007-06-20 Thread Aruna Goke
Chas Owens wrote: On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote: snip This might not be necessary for the RDMS you use, but I generally end my database-driven scripts with this block: END { if ($?) { print "Exiting with error, rolling back data!\n"; $dbh->rollback(); }

Re: the Database is not updated

2007-06-20 Thread Chas Owens
On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote: snip This might not be necessary for the RDMS you use, but I generally end my database-driven scripts with this block: END { if ($?) { print "Exiting with error, rolling back data!\n"; $dbh->rollback(); } else { prin

Re: the Database is not updated

2007-06-20 Thread Paul Lalli
On Jun 20, 2:23 pm, [EMAIL PROTECTED] (Aruna Goke) wrote: > Can someone put me thru this? > > when I run the script..it bring no error.. That's because you never asked it to give you any errors. That's something of a Perl trait - it generally doesn't tell you anything's wrong unless you ask it to

Re: the Database is not updated

2007-06-20 Thread Chas Owens
On 6/20/07, Aruna Goke <[EMAIL PROTECTED]> wrote: snip $sth->execute($x[2], $x[5], $x[4], $x[6]); snip I would also change this line to $sth->execute(@x[2,5,4,6]); But that is just because I am lazy. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: the Database is not updated

2007-06-20 Thread Chas Owens
On 6/20/07, Boyle, Christopher <[EMAIL PROTECTED]> wrote: Dumb question, does mysql need an explicit commit? The DBI does a commit after every statement unless you pass AutoCommit => 0 during the connect call. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: the Database is not updated

2007-06-20 Thread Chas Owens
On 6/20/07, Aruna Goke <[EMAIL PROTECTED]> wrote: snip $dbh = DBI->connect($data_source, $user, $pass); snip change this line to $dbh = DBI->connect( $data_source, $user, $pass { RaiseError => 1 } ); And the code will raise an error telling you what is wrong with the SQL

RE: the Database is not updated

2007-06-20 Thread Boyle, Christopher
Dumb question, does mysql need an explicit commit? -Original Message- From: Aruna Goke [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 20, 2007 2:23 PM To: beginners@perl.org; [EMAIL PROTECTED] Subject: the Database is not updated Can someone put me thru this? when I run the script..it