def get_options(): """ Return the options to be used in the script. """ parser = cx_OptionParser.OptionParser() parser.AddOption("--pipe-name", default="DbDebugger", metavar="NAME", prompt="Pipe name", help="use this pipe name for communication with the " "database") parser.AddOption(cx_OracleUtils.SchemaOption()) cx_LoggingOptions.AddOptions(parser) options = parser.Parse() cx_LoggingOptions.ProcessOptions(options) return options
parser.AddOption(Options.REPORT_POINT) parser.AddOption(Options.ARRAY_SIZE) parser.AddOption(Options.MAX_LONG_SIZE) parser.AddOption( "--source-role", metavar="ROLE", help="enable this <role> [identified by <password>] in the source " "database immediately after connecting by calling " "dbms_session.set_role") parser.AddOption( "--dest-role", metavar="ROLE", help="enable this <role> [identified by <password>] in the target " "database immediately after connecting by calling " "dbms_session.set_role") cx_LoggingOptions.AddOptions(parser) parser.AddArgument("source", required=True, help="a select statement or the name of the table to query") parser.AddArgument( "destination", help="the name of a table or view to perform the insert and update " "statements against") options = parser.Parse() cx_LoggingOptions.ProcessOptions(options) # set up the source connection sourceConnection = cx_OracleUtils.Connect(options.sourceSchema, options.sourceRole) sourceCursor = sourceConnection.cursor() if options.arraySize: