Index: openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql,v
diff -u -r1.3.2.1 -r1.3.2.2
--- openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql	20 Dec 2016 20:28:49 -0000	1.3.2.1
+++ openacs-4/packages/acs-kernel/sql/oracle/utilities-create.sql	21 Dec 2016 00:14:56 -0000	1.3.2.2
@@ -64,6 +64,13 @@
         table     IN varchar2,
 	column    IN varchar2)
     return LONG;
+
+    TYPE primary_keys IS TABLE OF varchar2;
+
+    function get_primary_keys(table IN varchar2)
+       return primary_keys
+	 PIPELINED;
+	 
 end util;
 /
 show errors
@@ -225,8 +232,24 @@
         FROM ALL_TAB_COLUMNS
 	 WHERE table_name = table
 	   AND column_name = column);
-    END get_default;    
+    END get_default;
 
+    function get_primary_keys(table IN varchar2)
+        return primary_keys IS
+        rec primary_keys;
+    BEGIN
+          SELECT cols.column_name
+	    BULK COLLECT INTO rec
+	  FROM all_constraints cons, all_cons_columns cols
+	  WHERE cols.table_name = table
+	  AND cons.constraint_type = 'P'
+	  AND cons.constraint_name = cols.constraint_name
+	  AND cons.owner = cols.owner
+	  ORDER BY cols.table_name, cols.position;
+
+        RETURN rec;
+    END get_primary_keys;
+
 end util;
 /
 show errors
