Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 8304)
+++ /trunk/psLib/src/db/psDB.c	(revision 8305)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-10 21:36:54 $
+ *  @version $Revision: 1.81 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-12 03:33:15 $
  *
  *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
@@ -1492,5 +1492,17 @@
     PS_ASSERT_PTR_NON_NULL(where, NULL);
 
-    char *query = psStringCopy("WHERE ");
+    psString search = psDBGenerateWhereConditionSQL(where);
+    if (search) {
+        psStringPrepend(&search, "WHERE ");
+    }
+
+    return search;
+}
+
+char *psDBGenerateWhereConditionSQL(const psMetadata *where)
+{
+    PS_ASSERT_PTR_NON_NULL(where, NULL);
+
+    char *query = NULL;
 
     // we need to know if an item is 'MULTI' so we have to march through the
Index: /trunk/psLib/src/db/psDB.h
===================================================================
--- /trunk/psLib/src/db/psDB.h	(revision 8304)
+++ /trunk/psLib/src/db/psDB.h	(revision 8305)
@@ -10,6 +10,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-09 04:30:00 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-08-12 03:33:15 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -364,4 +364,15 @@
 char    *psDBGenerateWhereSQL(const psMetadata *where);
 
+/** Generates an SQL "where conditon" statement
+ *
+ * This function generates a "Where" fragment but omits the "Where" keyword.
+ * This function generates an SQL fragment (not a whole usable query) based on
+ * the standard "where" metadata format.
+ *
+ * @return psString:   A psString or NULL on failure
+ */
+char *psDBGenerateWhereConditionSQL(const psMetadata *where);
+
+
 /// @}
 
