comparison sqlpyPlus.py @ 127:5d3f0b9c01df

resolve ambiguities in resolve
author catherine@localhost
date Mon, 04 Aug 2008 11:06:25 -0400
parents 898ed97bec38
children c5e6e475cdbe
comparison
equal deleted inserted replaced
126:d0e071e19c26 127:5d3f0b9c01df
137 WHERE dir.directory_name = :objName 137 WHERE dir.directory_name = :objName
138 UNION ALL 138 UNION ALL
139 SELECT 'DATABASE LINK' object_type, db_link, owner, 7 priority 139 SELECT 'DATABASE LINK' object_type, db_link, owner, 7 priority
140 FROM all_db_links dbl 140 FROM all_db_links dbl
141 WHERE dbl.db_link = :objName 141 WHERE dbl.db_link = :objName
142 ) ORDER BY priority ASC""", 142 ) ORDER BY priority ASC,
143 length(object_type) ASC,
144 object_type DESC""", # preference: PACKAGE before PACKAGE BODY, TABLE before INDEX
143 'tabComments': """ 145 'tabComments': """
144 SELECT comments 146 SELECT comments
145 FROM all_tab_comments 147 FROM all_tab_comments
146 WHERE owner = :owner 148 WHERE owner = :owner
147 AND table_name = :table_name""", 149 AND table_name = :table_name""",
667 except TypeError: 669 except TypeError:
668 print 'Could not resolve object %s.' % identifier 670 print 'Could not resolve object %s.' % identifier
669 object_type, owner, object_name = '', '', '' 671 object_type, owner, object_name = '', '', ''
670 return object_type, owner, object_name 672 return object_type, owner, object_name
671 #todo: resolve not finding cwm$ table 673 #todo: resolve not finding cwm$ table
674 #todo: names can overlap: view/trigger; index/index partition; table/table partition;
675 #package/package body; table/index; type/type body;
672 676
673 def do_resolve(self, arg): 677 def do_resolve(self, arg):
674 self.stdout.write(self.resolve(arg)+'\n') 678 self.stdout.write(self.resolve(arg)+'\n')
675 679
676 def spoolstop(self): 680 def spoolstop(self):