# HG changeset patch # User catherine@cordelia # Date 1207237360 14400 # Node ID 833e9d251da336b2be4feab0855df40056f86b50 # Parent 1eefe17b36302daa4dcf89b27256486481b8bf45 add head diff -r 1eefe17b3630 -r 833e9d251da3 sqlpyPlus.py --- a/sqlpyPlus.py Thu Apr 03 11:21:26 2008 -0400 +++ b/sqlpyPlus.py Thu Apr 03 11:42:40 2008 -0400 @@ -726,6 +726,20 @@ def do__dir_schemas(self, arg): self.do_select("""owner, count(*) AS objects FROM all_objects GROUP BY owner ORDER BY owner""") + def do_head(self, arg): + nrows = 10 + args = arg.split() + if len(args) > 1: + for a in args: + if a[0] == '-': + try: + nrows = int(a[1:]) + args.remove(a) + except: + pass + arg = ' '.join(args) + self.do_select('* from %s;%d' % (arg, nrows)) + def do_print(self, arg): 'print VARNAME: Show current value of bind variable VARNAME.' if arg: