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 making
#!/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();
If 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.

In reply to perl script to delete or update an ORACLE table hangs during execution by pmModule2012

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.