$dsn=$config->{'DSN'}; $db = new Win32::ODBC("$dsn"); if (!$db) { print "Cannot connect to DSN $dsn\n"; return 0; } #@updatequeryarray is the array containing the Update statements #for eg.: UPDATE EMPLOYEE SET REMARKS='Test now for Ryan' WHERE EM +P_NO='295' AND EMP_JOIN_YEAR='200102' foreach my $query (@updatequeryarray) { $dbgstr.="\n $query"; $db->Sql($query); } $db->Close();
Here I have inserted the Update statements into the @updatequeryarray! But on execution the update statement works only the first time in the loop. I don't understand why the update statements does not work when executed thru a loop!!!
So to bypass the problem and to set the things working for the time being, I have changed the code so that each time the for loop is executed, a connection to the database is made and after updation of the single record the connection is closed.
I seek the wisdom of the Perl Monks in this!!!!
Thanks in advance
George
In reply to Win32::ODBC - Update SQL statement by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |