comparison sqlpyPlus.py @ 63:16618ff91c63

fixed pull bug
author catherine@cordelia
date Thu, 03 Apr 2008 11:47:08 -0400
parents 833e9d251da3
children 047f82acdc8f
comparison
equal deleted inserted replaced
62:833e9d251da3 63:16618ff91c63
536 --full, -f: get dependent objects as well""" 536 --full, -f: get dependent objects as well"""
537 537
538 options, arg = self.pullflags.parse(arg) 538 options, arg = self.pullflags.parse(arg)
539 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper()) 539 object_type, owner, object_name = self.resolve(arg.strip(self.terminator).upper())
540 self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name)) 540 self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name))
541 self.stdout.write(self.curs.callfunc('DBMS_METADATA.GET_DDL', cx_Oracle.CLOB, 541 self.stdout.write(str(self.curs.callfunc('DBMS_METADATA.GET_DDL', cx_Oracle.CLOB,
542 [object_type, object_name, owner])+'\n') 542 [object_type, object_name, owner])))
543 if options.has_key('full'): 543 if options.has_key('full'):
544 for dependent_type in ('OBJECT_GRANT', 'CONSTRAINT', 'TRIGGER'): 544 for dependent_type in ('OBJECT_GRANT', 'CONSTRAINT', 'TRIGGER'):
545 try: 545 try:
546 self.stdout.write(self.curs.callfunc('DBMS_METADATA.GET_DEPENDENT_DDL', cx_Oracle.CLOB, 546 self.stdout.write(str(self.curs.callfunc('DBMS_METADATA.GET_DEPENDENT_DDL', cx_Oracle.CLOB,
547 [dependent_type, object_name, owner])+'\n') 547 [dependent_type, object_name, owner])))
548 except cx_Oracle.DatabaseError: 548 except cx_Oracle.DatabaseError:
549 pass 549 pass
550 550
551 findflags = flagReader.FlagSet([flagReader.Flag('insensitive')]) 551 findflags = flagReader.FlagSet([flagReader.Flag('insensitive')])
552 def do_find(self, arg): 552 def do_find(self, arg):