comparison sqlpyPlus.py @ 87:2de82dd6eba2

back to dellzilla
author catherine@cordelia
date Tue, 20 May 2008 10:08:14 -0400
parents ca5d615d8207
children d3da34473a8e
comparison
equal deleted inserted replaced
86:ca5d615d8207 87:2de82dd6eba2
571 if not arg: 571 if not arg:
572 self.do_select("""object_name, object_type%s FROM %s_objects WHERE object_type IN ('TABLE','VIEW','INDEX') ORDER BY object_name""" % which_view) 572 self.do_select("""object_name, object_type%s FROM %s_objects WHERE object_type IN ('TABLE','VIEW','INDEX') ORDER BY object_name""" % which_view)
573 return 573 return
574 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper()) 574 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper())
575 if not object_type: 575 if not object_type:
576 if opts.all: 576 self.do_select("""object_name, object_type%s FROM %s_objects
577 self.do_select("""object_name, object_type%s FROM %s_objects 577 WHERE object_type IN ('TABLE','VIEW','INDEX')
578 WHERE object_type IN ('TABLE','VIEW','INDEX') 578 AND object_name LIKE '%%%s%%'
579 AND object_name LIKE '%%%s%%' 579 ORDER BY object_name""" %
580 ORDER BY object_name""" % 580 (which_view[0], which_view[1], arg.upper()) )
581 (which_view[0], which_view[1], arg.upper()) )
582 return 581 return
583 self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name)) 582 self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name))
584 descQ = descQueries.get(object_type) 583 descQ = descQueries.get(object_type)
585 if descQ: 584 if descQ:
586 for q in descQ: 585 for q in descQ:
856 self.anon_plsql('begin ' + arg) 855 self.anon_plsql('begin ' + arg)
857 856
858 def do_declare(self, arg): 857 def do_declare(self, arg):
859 self.anon_plsql('declare ' + arg) 858 self.anon_plsql('declare ' + arg)
860 859
861 def do_create(self, arg): 860 #def do_create(self, arg):
862 self.anon_plsql('create ' + arg) 861 # self.anon_plsql('create ' + arg)
863 862
864 @options([make_option('-l', '--long', action='store_true', help='long descriptions')]) 863 @options([make_option('-l', '--long', action='store_true', help='long descriptions')])
865 def do_ls(self, arg, opts): 864 def do_ls(self, arg, opts):
866 where = '' 865 where = ''
867 if arg: 866 if arg: