Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help: DBI in oracle
> > my $dbh = DBI->connect ( 'dbi:Oracle:test',
> > 'test',
> > 'test',
> > {
> > PrintError => 1,
> > RaiseError => 1,
> > AutoCommit => 1
^^^^^^^^^^^^^^^$DBI::errstr" ;
> > }
> > ) || die "Database Connection not made
You have set AutoCommit on and are trying to use a rollback segment?
Turn it off (AutoCommit => 0) and then try. Be sure to do an explicit commit
when you are done with
the transaction.
Anurag
"Adam Hapworth" <hap_at_mikomi.org> wrote in message
news:a6cb04db.0109240830.4ea42f30_at_posting.google.com...
> u518615722_at_spawnkill.ip-mobilphone.net (Mike F) wrote in message
news:<l.1001014491.1000518798@[64.94.198.252]>...
> > Hi, I am posting here because I know a lot of good DBAs are also good
> > perl programmer. I have a perl scripts which I want to use only one
rollback segment.
> > the script is like the follow:
> > _----------------------------------------------------------------
> > my $dbh = DBI->connect ( 'dbi:Oracle:test',
> > 'test',
> > 'test',
> > {
> > PrintError => 1,
> > RaiseError => 1,
> > AutoCommit => 1
> > }
> > ) || die "Database Connection not made
$DBI::errstr" ;
> >
> > TO_DATE syntax in a sql statment would look like this > "select to_date('2001/1/$count1 00:00:00','yyyy/mm/dd hh24:mi:ss') > from dual;" >> > $dbh->disconnect();
> > $count1 = $count1 + 1;
> >
> > # set rollback segment
> > my $sql = qq{ set transaction use rollback segment RBS0 };
> > $dbh->do ( $sql );
> >
> > #move data from test to archtest
> > my $sql = qq{
> > INSERT INTO table1 select * from table2
> > where polltime > $T1 and polltime < $T2};
> > $dbh->do ( $sql );
> > }
> >
> >
> > That may be the problem but I do question your logic in the while. > while ($count1 > 32) > will work great for months that have 31 days in them but say febuary > with only 28 will give you an error and no rows in oracle for the last > three days (given it isn't a leap year). Also not sure how DBI > handles Oracle transactions. If Dbi commits each statement then you > will not be able to rollback like you are thinking. I am not a Oracle > pro yet but getting there so I may be slightly off. > > AdamReceived on Mon Sep 24 2001 - 13:24:36 CDT