diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 9b1b7896e..42a121767 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -1426,11 +1426,18 @@ sub setAttribs $action = "u"; for my $col (keys %$elems) { - $cols = $cols . $col . " = ?,"; + if ($xcatcfg =~ /^DB2:/) { #for DB2 + my $colsq = q(") . $col . q("); # quote columns + $cols = $cols . $colsq . " = ?,"; + } else { + $cols = $cols . $col . " = ?,"; + } push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col}); } chop($cols); - my $cmd = "UPDATE " . $self->{tabname} . " set $cols where "; + my $cmd ; + + $cmd = "UPDATE " . $self->{tabname} . " set $cols where "; foreach (keys %keypairs) { if (ref($keypairs{$_}))