# HG changeset patch # User catherine@localhost # Date 1217862385 14400 # Node ID 5d3f0b9c01df64ee59beef0dcb4c6eee791e31d0 # Parent d0e071e19c26378bf0c3b8ced7158cb558477357 resolve ambiguities in resolve diff -r d0e071e19c26 -r 5d3f0b9c01df setup.py --- a/setup.py Wed Jul 30 12:41:26 2008 -0400 +++ b/setup.py Mon Aug 04 11:06:25 2008 -0400 @@ -9,7 +9,7 @@ Operating System :: OS Independent""".splitlines() setup(name="sqlpython", - version="1.4.7", + version="1.4.7.1", description="Command-line interface to Oracle", long_description="Customizable alternative to Oracle's SQL*PLUS command-line interface", author="Luca Canali", diff -r d0e071e19c26 -r 5d3f0b9c01df sqlpyPlus.py --- 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')