add getSchema
diff --git a/plugins/org.eclipse.datatools.sqltools.editor.core/src/org/eclipse/datatools/sqltools/sql/util/ModelUtil.java b/plugins/org.eclipse.datatools.sqltools.editor.core/src/org/eclipse/datatools/sqltools/sql/util/ModelUtil.java
index 845f9e9..7f65ec3 100644
--- a/plugins/org.eclipse.datatools.sqltools.editor.core/src/org/eclipse/datatools/sqltools/sql/util/ModelUtil.java
+++ b/plugins/org.eclipse.datatools.sqltools.editor.core/src/org/eclipse/datatools/sqltools/sql/util/ModelUtil.java
@@ -173,19 +173,33 @@
      * @return
      */
     public static String getSchemaName(EObject obj) {
+        Schema schema = getSchema(obj);
+        if (schema != null)
+        {
+            return schema.getName();
+        }
+        return null;
+    }
+	
+    /**
+     * Returns the schema by looking up parent in the containment service.
+     * @param 
+     * @return
+     */
+    public static Schema getSchema(EObject obj) {
         EObject container = ContainmentServiceImpl.INSTANCE.getContainer(obj);
         while (container != null)
         {
             obj = container;
             if (obj instanceof Schema)
             {
-                return ((Schema)obj).getName();
+                return ((Schema)obj);
             }
             container = ContainmentServiceImpl.INSTANCE.getContainer(obj);
         }
         return null;
     }
-	
+    
 	public static IConnectionProfile getConnectionProfile(Database database) {
 		if (database != null) {
 			ConnectionInfo connInfo = DatabaseConnectionRegistry.getInstance()