From 2067bafb90373ee50efbfef7bcc2b8d10bd04137 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 6 Apr 2010 13:32:23 +0000 Subject: [PATCH] more work on getAllAttribsWhere git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5683 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Table.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 46219235c..b3ac8dd48 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -1574,7 +1574,7 @@ sub setAttribs This function sets the attributes for the rows selected by the where clause. Warning, because we support mulitiple databases (SQLite,MySQL and DB2) that require different syntax. Any code using this routine, must call the - Utils->get_DBName routine and code the where clause that is appropriate for + Utils->getDBName routine and code the where clause that is appropriate for each supported database. Arguments: @@ -2414,17 +2414,14 @@ sub getAllAttribsWhere my @results = (); my $query; my $query2; - $query2='SELECT * FROM ' . $self->{tabname} . ' WHERE (' . $whereclause . ") and " . q(`disable`) . " is NULL or " . q(`disable`) . " in ('0','no','NO','No','nO')"; if ($xcatcfg =~ /^mysql:/) { #for mysql + $query2='SELECT * FROM ' . $self->{tabname} . ' WHERE (' . $whereclause . ") and " . q(`disable`) . " is NULL or " . q(`disable`) . " in ('0','no','NO','No','nO')"; $query = $self->{dbh}->prepare($query2); } else { if ($xcatcfg =~ /^DB2:/) { #for DB2 - $query = $self->{dbh}->prepare('SELECT * FROM ' - . $self->{tabname} - . ' WHERE (' - . $whereclause - . " ) and (\"disable\" is NULL OR \"disable\" LIKE '0' OR \"disable\" LIKE 'no' OR \"disable\" LIKE 'NO' OR \"disable\" LIKE 'No' OR \"disable\" LIKE 'nO')"); + $query2= 'SELECT * FROM ' . $self->{tabname} . ' WHERE (' . $whereclause . " ) and (\"disable\" is NULL OR \"disable\" LIKE '0' OR \"disable\" LIKE 'no' OR \"disable\" LIKE 'NO' OR \"disable\" LIKE 'No' OR \"disable\" LIKE 'nO')"; + $query = $self->{dbh}->prepare($query2); } else { # for other dbs $query = $self->{dbh}->prepare('SELECT * FROM '