comparison sqlpyPlus.py @ 62:833e9d251da3

add head
author catherine@cordelia
date Thu, 03 Apr 2008 11:42:40 -0400
parents 1eefe17b3630
children 16618ff91c63
comparison
equal deleted inserted replaced
61:1eefe17b3630 62:833e9d251da3
724 self.do_select("""tablespace_name, file_name from dba_data_files""") 724 self.do_select("""tablespace_name, file_name from dba_data_files""")
725 725
726 def do__dir_schemas(self, arg): 726 def do__dir_schemas(self, arg):
727 self.do_select("""owner, count(*) AS objects FROM all_objects GROUP BY owner ORDER BY owner""") 727 self.do_select("""owner, count(*) AS objects FROM all_objects GROUP BY owner ORDER BY owner""")
728 728
729 def do_head(self, arg):
730 nrows = 10
731 args = arg.split()
732 if len(args) > 1:
733 for a in args:
734 if a[0] == '-':
735 try:
736 nrows = int(a[1:])
737 args.remove(a)
738 except:
739 pass
740 arg = ' '.join(args)
741 self.do_select('* from %s;%d' % (arg, nrows))
742
729 def do_print(self, arg): 743 def do_print(self, arg):
730 'print VARNAME: Show current value of bind variable VARNAME.' 744 'print VARNAME: Show current value of bind variable VARNAME.'
731 if arg: 745 if arg:
732 if arg[0] == ':': 746 if arg[0] == ':':
733 arg = arg[1:] 747 arg = arg[1:]