Fix setattribs sql statement structure for postgresql statement parse error
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@309 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
e2c97a9c88
commit
69e280dbf3
@ -706,15 +706,19 @@ sub setAttribs
|
||||
$action = "a";
|
||||
@bind = ();
|
||||
$cols = "";
|
||||
my %newpairs;
|
||||
#first, merge the two structures to a single hash
|
||||
foreach (keys %keypairs)
|
||||
{
|
||||
$cols .= $_ . ",";
|
||||
push @bind, $keypairs{$_};
|
||||
}
|
||||
$newpairs{$_} = $keypairs{$_};
|
||||
}
|
||||
for my $col (keys %$elems)
|
||||
{
|
||||
$cols = $cols . $col . ",";
|
||||
push @bind, $$elems{$col};
|
||||
$newpairs{$col} = $$elems{$col};
|
||||
}
|
||||
foreach (keys %newpairs) {
|
||||
$cols .= $_ . ",";
|
||||
push @bind, $newpairs{$_};
|
||||
}
|
||||
chop($cols);
|
||||
my $qstring = 'INSERT INTO ' . $self->{tabname} . " ($cols) VALUES (";
|
||||
|
Loading…
x
Reference in New Issue
Block a user