# HG changeset patch # User catherine@Elli.myhome.westell.com # Date 1238020942 14400 # Node ID 0d16630d8e045c0ed88636b7c34f9ae063389ae3 # Parent 4d24fea42364cb14df86423e6f43ed52ad4f6823 added table comment to desc -l diff -r 4d24fea42364 -r 0d16630d8e04 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Wed Mar 25 17:16:23 2009 -0400 +++ b/sqlpython/sqlpyPlus.py Wed Mar 25 18:42:22 2009 -0400 @@ -420,6 +420,11 @@ commentGrammars = pyparsing.Or([Parser.comment_def, pyparsing.cStyleComment]) prefixParser = pyparsing.Optional(pyparsing.Word(pyparsing.nums)('connection_number') + ':') + reserved_words = [ + 'alter', 'begin', 'comment', 'create', 'delete', 'drop', 'end', 'for', 'grant', + 'insert', 'intersect', 'lock', 'minus', 'on', 'order', 'rename', + 'resource', 'revoke', 'select', 'share', 'start', 'union', 'update', + 'where', 'with'] default_file_name = 'afiedt.buf' def __init__(self): sqlpython.sqlpython.__init__(self) @@ -439,6 +444,7 @@ self.substvars = {} self.result_history = [] self.store_results = True + self.pystate = {'r': [], 'binds': self.binds, 'substs': self.substvars} # overrides cmd's parseline @@ -1021,6 +1027,9 @@ self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name)) try: if object_type == 'TABLE': + if opts.long: + self._execute(queries['tabComments'], {'table_name':object_name, 'owner':owner}) + self.stdout.write(self.curs.fetchone()[0]) descQ = descQueries[object_type][opts.long] else: descQ = descQueries[object_type][opts.long]