Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLSelect.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLSelect.java	(revision 5947)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLSelect.java	(revision 5948)
@@ -3,8 +3,10 @@
 public class GS3SQLSelect extends GS3SQLAction
 { GS3SQLWhere where;
+  boolean     distinct;
 
   public GS3SQLSelect(String table)
   { super(table);
     this.where  = null;
+    this.distinct = false;
   }
     
@@ -13,8 +15,16 @@
   }
 
+  public void setDistinct(boolean distinct)
+  { this.distinct = distinct;
+  }
+
   public String toString()
   { StringBuffer reply = new StringBuffer();
   
     reply.append("SELECT ");
+
+    if (this.distinct)
+    { reply.append("DISTINCT ");
+    }
  
     for (int i = 0; i < this.values.size(); i ++)
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLUpdate.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLUpdate.java	(revision 5947)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLUpdate.java	(revision 5948)
@@ -25,5 +25,15 @@
         reply.append(value.field);
 	reply.append("=");
+	if (value.getType() == null ||
+	    value.getType().equals(GS3SQLField.VARCHAR_TYPE))
+	{
+	    reply.append("\"");
+	}
 	reply.append(value.value);
+	if (value.getType() == null ||
+	    value.getType().equals(GS3SQLField.VARCHAR_TYPE))
+	{
+	    reply.append("\"");
+	}
       }
       if (this.where != null)
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLWhere.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLWhere.java	(revision 5947)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/database/GS3SQLWhere.java	(revision 5948)
@@ -5,39 +5,51 @@
 
 public class GS3SQLWhere implements GS3SQLWhereElement
-  { String condition;
-    List   elements;
+{ String condition;
+  List   elements;
 
-    public GS3SQLWhere(GS3SQLWhereElement element)
-    { this.condition = "AND";
-      this.elements  = new ArrayList();
-      this.elements.add(element);
-    }
+  public static final String AND_CONDITION = "AND";
+  public static final String OR_CONDITION = "OR";
 
-    public GS3SQLWhere(GS3SQLWhereElement element, String condition, GS3SQLWhereElement other)
-    { this.elements = new ArrayList();
-      this.elements.add(element);
-      this.elements.add(other);
-      this.condition = condition;
-    }
-
-    public void add(GS3SQLWhereElement element)
-    { this.elements.add(element);
-    }
-
-    public String toString()
-    { StringBuffer reply = new StringBuffer();
-
-      for (int i = 0; i < this.elements.size(); i ++)
-      {
-	if (i != 0) {
-	  reply.append(" ");
-	  reply.append(this.condition);
-	  reply.append(" ");
-	}
-	reply.append(this.elements.get(i).toString());
-      }
-      return reply.toString();
-    }
+  public GS3SQLWhere(GS3SQLWhereElement element)
+  { this.condition = AND_CONDITION;
+    this.elements  = new ArrayList();
+    this.elements.add(element);
   }
 
+  public GS3SQLWhere()
+  { this.condition = AND_CONDITION;
+    this.elements  = new ArrayList();   
+  }
 
+  public GS3SQLWhere(GS3SQLWhereElement element, String condition, GS3SQLWhereElement other)
+  { this.elements = new ArrayList();
+    this.elements.add(element);
+    this.elements.add(other);
+    this.condition = condition;
+  }
+
+  public void add(GS3SQLWhereElement element)
+  { this.elements.add(element);
+  }
+
+  public String toString()
+  { StringBuffer reply = new StringBuffer();
+
+    for (int i = 0; i < this.elements.size(); i ++)
+    {
+      if (i != 0) {
+	reply.append(" ");
+	reply.append(this.condition);
+	reply.append(" ");
+      }
+      reply.append(this.elements.get(i).toString());
+    }
+    return reply.toString();
+  }
+
+  public void setCondition(String condition)
+  { this.condition = condition;
+  }
+}
+
+
