pmModule2012 has asked for the wisdom of the Perl Monks concerning the following question:
Recently I have written a perl script using PERL DBI module to perform SQL operations on an ORACLE table. "SELECT" query is working fine and I got the expected result but the "DELETE" and "UPDATE" statements are not happening and the script is getting hanged.
I don't think this as a permission issue for the userid cause when I am trying to execute those "DELETE' and UPDATE" statements from SQL promt (with the same userid used in perlscript), both the operations are successful. Please guide me on this.. Thanks in advance :)
I am using the below script.. Please verify if there is some mistake I am makingIf I manually go to the sql promt and fire the statement, it works. Moreover, the same code works when I am trying it for some other table.#!/usr/bin/perl -w use strict; use DBI; my $user="@@@@@"; my $pw="******"; my $database="mydb"; my $dsn = "dbi:Oracle:$database"; my $connect = DBI->connect($dsn,$user,$pw) or die "Unable +to connect: $DBI::errstr\n"; print "\n Connection Established\n"; my ($query,$query_handle); # PREPARE THE QUERY $query = qq/Delete from <mytable1> /; $query_handle = $connect->prepare($query); # EXECUTE THE QUERY $query_handle->execute(); print "\n Deletion in progress...\n"; $query_handle->finish(); $connect->commit; print "\n Commit Done\n"; $connect->disconnect();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl script to delete or update an ORACLE table hangs during execution
by davido (Cardinal) on Jun 04, 2012 at 18:52 UTC | |
|
Re: perl script to delete or update an ORACLE table hangs during execution
by erix (Prior) on Jun 04, 2012 at 20:40 UTC | |
|
Re: perl script to delete or update an ORACLE table hangs during execution
by davido (Cardinal) on Jun 05, 2012 at 09:23 UTC | |
by prashantktyagi (Scribe) on Jun 05, 2012 at 11:34 UTC | |
by davido (Cardinal) on Jun 05, 2012 at 18:52 UTC |