Thanks monks! for thy replies!

The reason I use ODBC instead of DBI/DBD is that it gives me DATABASE independence
(so that I can use the same module for updating records into other RDBMS backend with no or little tweaking around with the code!).
I know connecting, updating the database and disconnecting for time the loop is excuted is dumb,
but had to get it to work
As far the semicolon at the end of the statement is concerned -
it's NOT necessary (oracle seems to be comfortable without semicols)!
I am getting the SQL statements generated into a log file and it's perfect!
And I have put up the code for printing the error if any during the Sql statement execution

So that my code looks like this now:
#@updatequeryarray is the array containing the Update statements
#for eg.: UPDATE EMPLOYEE SET REMARKS='Test now for Ryan' WHERE EMP_NO='295' AND EMP_JOIN_YEAR='200102'
$dsn=$config->{'DSN'};
foreach my $query (@updatequeryarray) {
$db = new Win32::ODBC("$dsn");
if (!$db) {
print "Cannot connect to DSN $dsn\n";
return 0;
}
$dbgstr.="\n $query";
if ($db->Sql($query)) {
print "Database Updatation Error".$db->error;
}
$db->Sql("commit");
$db->Close();
}

if (!open(DBGRESP,">>$config->{'PATH-RESPONSES'}/SQL")) {
print "Error Appending DBG file\n";
return 0;
}
print DBGRESP "$dbgstr";
close DBGRESP;

In reply to Re: Re: Win32::ODBC - Update SQL statement by Anonymous Monk
in thread Win32::ODBC - Update SQL statement by Anonymous Monk

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.