diff sqlpyPlus.py @ 127:5d3f0b9c01df

resolve ambiguities in resolve
author catherine@localhost
date Mon, 04 Aug 2008 11:06:25 -0400
parents 898ed97bec38
children c5e6e475cdbe
line wrap: on
line diff
--- a/sqlpyPlus.py	Wed Jul 30 12:41:26 2008 -0400
+++ b/sqlpyPlus.py	Mon Aug 04 11:06:25 2008 -0400
@@ -139,7 +139,9 @@
 SELECT 'DATABASE LINK' object_type, db_link, owner, 7 priority
 FROM   all_db_links dbl
 WHERE  dbl.db_link = :objName
-) ORDER BY priority ASC""",
+) ORDER BY priority ASC,
+           length(object_type) ASC,
+           object_type DESC""", # preference: PACKAGE before PACKAGE BODY, TABLE before INDEX
 'tabComments': """
 SELECT comments
 FROM    all_tab_comments
@@ -669,6 +671,8 @@
             object_type, owner, object_name = '', '', ''
         return object_type, owner, object_name
         #todo: resolve not finding cwm$ table
+        #todo: names can overlap: view/trigger; index/index partition; table/table partition;
+        #package/package body; table/index; type/type body; 
 
     def do_resolve(self, arg):
         self.stdout.write(self.resolve(arg)+'\n')