473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AutoCommit + Perl + Oracle

Hi, Anyone having idea how to disable autocommit while executing query with perl. I am using oracle 9i and perl 5.8 but when ever i execute any update query it autocommit.
++++++++++++++++++++++ Below is wht i am doing for disabling it +++++++++++++++==
#!/Opt/perl64/bin/perl
use DBI;
$dbh = DBI->connect('DBI:Oracle:iobastst','nidhitabs','nidhit abs',{AutoCommit => 0}) or die "Couldn't connect to database: " . DBI->errstr;
$dbh->{AutoCommit} = 0;
$sth = $dbh->prepare("nsert into cams_file_mv_status values ('$data1','$!','$data')") or die "Couldn't prepare statement: " . $dbh->errstr;) or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute();
Apr 9 '07 #1
1 2611
Hi, Anyone having idea how to disable autocommit while executing query with perl. I am using oracle 9i and perl 5.8 but when ever i execute any update query it autocommit.
++++++++++++++++++++++ Below is wht i am doing for disabling it +++++++++++++++==
#!/Opt/perl64/bin/perl
use DBI;
$dbh = DBI->connect('DBI:Oracle:iobastst','nidhitabs','nidhit abs',{AutoCommit => 0}) or die "Couldn't connect to database: " . DBI->errstr;
$dbh->{AutoCommit} = 0;
$sth = $dbh->prepare("nsert into cams_file_mv_status values ('$data1','$!','$data')") or die "Couldn't prepare statement: " . $dbh->errstr;) or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute();
Disconnecting from a database may cause outstanding changes to be committed. This has nothing to do with DBI. It depends on the RDBMS. If you do not wish to commit the changes call $dbh->rollback() before calling $dbh->disconnect().

Another advice is to use $dbh->do() for non-SELECT statements. It is simpler. :-)
Apr 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jy2003 | last post by:
Below is what I got by using MySQL's --log startup option. The original Java(with JDBC driver) program that creates the queries at runtime was coded by other people, and unfortunately, they are not...
2
by: Steven | last post by:
imf...@yahoo.com Dec 24, 5:47 am show options Newsgroups: comp.lang.perl.modules From: imf...@yahoo.com - Find messages by this author Date: 24 Dec 2004 05:47:04 -0800 Local: Fri, Dec 24...
1
by: Marcel Czerny | last post by:
Hi, I've got some troubles with exporting data base entries from an "Access"-table (ver. 10) into an "Oracle"-table (ver. 9.2) using the "Oracle-ODBC-driver". At first I linked the...
0
by: Bricklen | last post by:
Hi all, I've scoured the net for a simple way to set AUTOCOMMIT off in psql, for the duration of a session (not simply a transaction). The only real reference that I can find says that "\set...
2
by: Antony Paul | last post by:
Hi all How to set autocommit off. I want transactions which requires explicit commit and after commit a new transaction is started as in Oracle sql plus. When using start transaction it requires...
33
by: John Sidney-Woollett | last post by:
With the advent of postgres v8, would it be possible to change the default behaviour of psql from AUTOCOMMIT=ON to AUTOCOMMIT=OFF ? Although this might break backward compatibility, it might be...
1
by: aditya Kulkarni | last post by:
Hi , I have an application that ran on Oracle, and the application, for some reason requires autocommit to be true. Now, when we moved this application to postgres, we moved the blob column to...
1
by: vasilip | last post by:
Can anyone help me out with these two issues I seem to be having? using the db2 driver for PHP (db2_xxxxxx) functions 1. If I forget, or for some reason db2_commit/db2_rollback doesn't get...
1
by: megaman1 | last post by:
I’m trying to connect with perl DBD::Oracle on Windows to Oracle DB (Linux). I compiled the Oracle.dll using the commands “perl Makefile.pl” “nmake” and “nmake install”, but when I try to connect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.