Hi,
I have a very simple script to delete records from an Oracle table :
#!/usr/bin/perl
use DBI;
use DBD::Oracle;
$dbh = DBI-connect( dbi:Oracle:database, user, password) or die
Can't connect to Oracle database: $DBI::errstr\n;
$dbh-do( DELETE FROM TABLE WHERE YEAR=2003 );
exit;
the script
On 11/24/2004 06:19 AM, Mark Martin said:
I have a very simple script to delete records from an Oracle table :
#!/usr/bin/perl
use DBI;
use DBD::Oracle;
$dbh = DBI-connect( dbi:Oracle:database, user, password) or die
Can't connect to Oracle database: $DBI::errstr\n;
$dbh-do( DELETE FROM TABLE
Michael,
thanks for the quick response.
TABLE was just an example.
tried your error checking and nothing came up. So, went back to :
1. defining the SQL statement instead.
2. preparing the statement handler - my $sth = $dbh-prepare($sql)
3. executing - $sth-execute()
...instead of a $dbh-do.
How long does 'delete from table where year = 2003' take in SQLPlus?
On Nov 24, Mark Martin scribed:
Michael,
thanks for the quick response.
TABLE was just an example.
tried your error checking and nothing came up. So, went back to :
1. defining the SQL statement instead.
2. preparing
49620 rows deleted in ~ 15 seconds.
( I have tried the delete from DBI on varying subsets of data all the way
down to 1 record (the only delete that works))
At 10:57 24/11/2004 -0500, David N Murray wrote:
How long does 'delete from table where year = 2003' take in SQLPlus?
On Nov 24, Mark
Mark Martin [mailto:[EMAIL PROTECTED] wrote:
49620 rows deleted in ~ 15 seconds.
( I have tried the delete from DBI on varying subsets of data all the way
down to 1 record (the only delete that works))
Might you have one of the rows you're trying to delete from DBI locked in
SQLPLUS? Make
I do what you originally did ($dbh-do(delete...) all the time on Oracle
8.1.7. The only difference I have is
my $dbh = DBI-connect(dbi:Oracle:database, user, pass,
{ RaiseError = 1, AutoCommit = 0 });
i.e. I explicitly set AutoCommit off. I always have done that, and
Brilliant - that's it! Thank you!
Would SELECTs lock up a record without a commit statement?
Mark
At 11:15 24/11/2004 -0500, Ronald J Kimball wrote:
Mark Martin [mailto:[EMAIL PROTECTED] wrote:
49620 rows deleted in ~ 15 seconds.
( I have tried the delete from DBI on varying subsets of data all
PROTECTED]
Subject: RE: Why wont my script finish?
Brilliant - that's it! Thank you!
Would SELECTs lock up a record without a commit statement?
Mark
At 11:15 24/11/2004 -0500, Ronald J Kimball wrote:
Mark Martin [mailto:[EMAIL PROTECTED] wrote:
49620 rows deleted in ~ 15 seconds.
( I have
Message-
From: Mark Martin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 24, 2004 9:26 AM
To: Ronald J Kimball
Cc: [EMAIL PROTECTED]
Subject: RE: Why wont my script finish?
Brilliant - that's it! Thank you!
Would SELECTs lock up a record without a commit statement?
Mark
At 11:15 24/11/2004
I do what you originally did ($dbh-do(delete...) all the
time on Oracle 8.1.7. The only difference I have is
my $dbh = DBI-connect(dbi:Oracle:database, user, pass,
{ RaiseError = 1, AutoCommit = 0 });
i.e. I explicitly set AutoCommit off. I always have done
On Nov 24, Jeff Urlwin scribed:
I do what you originally did ($dbh-do(delete...) all the
time on Oracle 8.1.7. The only difference I have is
my $dbh = DBI-connect(dbi:Oracle:database, user, pass,
{ RaiseError = 1, AutoCommit = 0 });
i.e. I explicitly set
12 matches
Mail list logo