I am trying to update some rows in my DB2 db using ODBC, I am not getting any error but the update is not successful. I am using PERL language.

$connect='agftemp'; #DSN

if(!($dbh = new Win32::ODBC($connect))) {
print "Error Connecting to $connect\n";
die("Error:" .Win32::ODBC::Error(). "\n");

$cmd2 = "UPDATE ITEM_LNE set QTY_USED = $qty_used where ORDER_NO=$ordernum and LINE_NO=$line_no";

$dbh-> sql(cmd2);

Plase let me know what to change in above script.

The same update query (shown below) works fine without any problem if I make the connection but it is very slow

my $dbh_ITEM = DBI->connect("DBI:XBase:/agftemp") or die "XBASE DBD CUST COULD NOT BE OPENED.\n";

my $sth_QTY_USED = $dbh_ITEM->prepare("UPDATE ITEM_LNE set QTY_USED = $qty_used where ORDER_NO=$ordernum and LINE_NO=$line_no")or die "UPDATE QUERY COULD NOT BE PREPARED FOR ITEM_LNE.DBF QTY_USED.\n";


Is someone who can help me with the script mentioned on top. r if you can please let me know some online documentation about PERL::ODBC::win32?