comparison sqlpyPlus.py @ 82:5485b66c3445

initial switchover done
author catherine@localhost
date Thu, 15 May 2008 14:01:20 -0400
parents 32c868fca272
children 5701fb63e81d
comparison
equal deleted inserted replaced
81:32c868fca272 82:5485b66c3445
527 print e 527 print e
528 import traceback 528 import traceback
529 traceback.print_exc(file=sys.stdout) 529 traceback.print_exc(file=sys.stdout)
530 self.sqlBuffer.append(self.query) 530 self.sqlBuffer.append(self.query)
531 531
532 @options([make_option('-f', '--full', action='store-true', help='get dependent objects as well')]) 532 @options([make_option('-f', '--full', action='store_true', help='get dependent objects as well')])
533 def do_pull(self, arg, opts): 533 def do_pull(self, arg, opts):
534 """Displays source code.""" 534 """Displays source code."""
535 535
536 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper()) 536 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper())
537 if not object_type: 537 if not object_type:
545 self.stdout.write(str(self.curs.callfunc('DBMS_METADATA.GET_DEPENDENT_DDL', cx_Oracle.CLOB, 545 self.stdout.write(str(self.curs.callfunc('DBMS_METADATA.GET_DEPENDENT_DDL', cx_Oracle.CLOB,
546 [dependent_type, object_name, owner]))) 546 [dependent_type, object_name, owner])))
547 except cx_Oracle.DatabaseError: 547 except cx_Oracle.DatabaseError:
548 pass 548 pass
549 549
550 @options([make_option('-i', '--insensitive', action='store-true', help='case-insensitive search')]) 550 @options([make_option('-i', '--insensitive', action='store_true', help='case-insensitive search')])
551 def do_find(self, arg, opts): 551 def do_find(self, arg, opts):
552 """Finds argument in source code.""" 552 """Finds argument in source code."""
553 553
554 if opts.insensitive: 554 if opts.insensitive:
555 searchfor = "LOWER(text)" 555 searchfor = "LOWER(text)"
829 self.anon_plsql('declare ' + arg) 829 self.anon_plsql('declare ' + arg)
830 830
831 def do_create(self, arg): 831 def do_create(self, arg):
832 self.anon_plsql('create ' + arg) 832 self.anon_plsql('create ' + arg)
833 833
834 @options([make_option('-l', '--long', action='store-true', help='long descriptions')]) 834 @options([make_option('-l', '--long', action='store_true', help='long descriptions')])
835 def do_ls(self, arg, opts): 835 def do_ls(self, arg, opts):
836 where = '' 836 where = ''
837 if arg: 837 if arg:
838 where = """\nWHERE object_type || '/' || object_name 838 where = """\nWHERE object_type || '/' || object_name
839 LIKE '%%%s%%'""" % (arg.upper().replace('*','%')) 839 LIKE '%%%s%%'""" % (arg.upper().replace('*','%'))