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();
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |