Index: /trunk/psLib/src/dataIO/psDB.c
===================================================================
--- /trunk/psLib/src/dataIO/psDB.c	(revision 4278)
+++ /trunk/psLib/src/dataIO/psDB.c	(revision 4279)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 19:52:21 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-16 01:48:18 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -255,19 +255,22 @@
     psPtr           data;               // copy of result field
 
+    // Generate SQL query string
     query = psDBGenerateSelectRowSQL(tableName, col, NULL, limit);
     if (!query) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Query generation failed.");
+        psError(PS_ERR_UNEXPECTED_NULL, false, PS_ERRORTEXT_psDB_QUERY_GEN_FAIL);
         return NULL;
     }
 
+    // Execut SQL query string
     if (!p_psDBRunQuery(dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psDB_SEL_COL_FAIL);
         psFree(query);
         return NULL;
     }
-
     psFree(query);
 
+    // Obtain query result and check for no data condition
     result = mysql_store_result(dbh->mysql);
+
     if (!result) {
         // no result set
@@ -277,9 +280,11 @@
         // then something bad has happened.
         if (fieldCount != 0) {
-            psError(PS_ERR_UNEXPECTED_NULL, true, "Query returned no data.  Error: %s", mysql_error(dbh->mysql));
+            psError(PS_ERR_UNEXPECTED_NULL, true, PS_ERRORTEXT_psDB_QUERY_NO_DATA,
+                    mysql_error(dbh->mysql));
             return NULL;
         }
     }
 
+    // Get number of rows returned in result
     rowCount = mysql_num_rows(result);
 
@@ -290,4 +295,5 @@
     column->n = 0;
 
+    // Fetch each result
     while ((row = mysql_fetch_row(result))) {
         // get the first element of lengths array that is part of the
@@ -309,4 +315,5 @@
     }
 
+    // Clean up mysql memory
     mysql_free_result(result);
 
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.dat
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4278)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 4279)
@@ -65,4 +65,6 @@
 psDB_SQL_QUERY_FAIL                    Failed to execute SQL query.  Error: %s
 psDB_TABLE_DROP_FAIL                   Failed to drop table.
+psDB_SEL_COL_FAIL                      Failed to select column.
+psDB_QUERY_NO_DATA                     Query returned no data.  Error: %s
 #
 
Index: /trunk/psLib/src/dataIO/psFileUtilsErrors.h
===================================================================
--- /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4278)
+++ /trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 4279)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 19:52:21 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-16 01:48:18 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -84,4 +84,6 @@
 #define PS_ERRORTEXT_psDB_SQL_QUERY_FAIL "Failed to execute SQL query.  Error: %s"
 #define PS_ERRORTEXT_psDB_TABLE_DROP_FAIL "Failed to drop table."
+#define PS_ERRORTEXT_psDB_SEL_COL_FAIL "Failed to select column."
+#define PS_ERRORTEXT_psDB_QUERY_NO_DATA "Query returned no data.  Error: %s"
 //~End
 
Index: /trunk/psLib/src/db/psDB.c
===================================================================
--- /trunk/psLib/src/db/psDB.c	(revision 4278)
+++ /trunk/psLib/src/db/psDB.c	(revision 4279)
@@ -12,6 +12,6 @@
  *  @author Joshua Hoblitt
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-06-15 19:52:21 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-06-16 01:48:18 $
  *
  *  Copyright 2005 Joshua Hoblitt, University of Hawaii
@@ -255,19 +255,22 @@
     psPtr           data;               // copy of result field
 
+    // Generate SQL query string
     query = psDBGenerateSelectRowSQL(tableName, col, NULL, limit);
     if (!query) {
-        psError(PS_ERR_UNEXPECTED_NULL, false, "Query generation failed.");
+        psError(PS_ERR_UNEXPECTED_NULL, false, PS_ERRORTEXT_psDB_QUERY_GEN_FAIL);
         return NULL;
     }
 
+    // Execut SQL query string
     if (!p_psDBRunQuery(dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "Query execution failed.");
+        psError(PS_ERR_UNKNOWN, false, PS_ERRORTEXT_psDB_SEL_COL_FAIL);
         psFree(query);
         return NULL;
     }
-
     psFree(query);
 
+    // Obtain query result and check for no data condition
     result = mysql_store_result(dbh->mysql);
+
     if (!result) {
         // no result set
@@ -277,9 +280,11 @@
         // then something bad has happened.
         if (fieldCount != 0) {
-            psError(PS_ERR_UNEXPECTED_NULL, true, "Query returned no data.  Error: %s", mysql_error(dbh->mysql));
+            psError(PS_ERR_UNEXPECTED_NULL, true, PS_ERRORTEXT_psDB_QUERY_NO_DATA,
+                    mysql_error(dbh->mysql));
             return NULL;
         }
     }
 
+    // Get number of rows returned in result
     rowCount = mysql_num_rows(result);
 
@@ -290,4 +295,5 @@
     column->n = 0;
 
+    // Fetch each result
     while ((row = mysql_fetch_row(result))) {
         // get the first element of lengths array that is part of the
@@ -309,4 +315,5 @@
     }
 
+    // Clean up mysql memory
     mysql_free_result(result);
 
