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
as necessary to make the destination match the source. Note that deletes are not performed, however. """ import cx_Logging import cx_LoggingOptions import cx_OptionParser import cx_OracleUtils import os import Exceptions import Options # parse command line parser = cx_OptionParser.OptionParser() parser.AddOption(cx_OracleUtils.SchemaOption("source-schema")) parser.AddOption(cx_OracleUtils.SchemaOption("dest-schema")) parser.AddOption( "--key-columns", metavar="COLS", help="comma separated list of columns to use for checking if the " "row exists") parser.AddOption("--no-check-exists", default=1, action="store_false", dest="checkExists", help="do not check to see if the row exists in the target") parser.AddOption( "--no-check-modified", default=1, action="store_false",
""" import cx_Logging import cx_LoggingOptions import cx_OptionParser import cx_Oracle import cx_OracleUtils import cx_XML import datetime import sys import Options # parse command line parser = cx_OptionParser.OptionParser() parser.AddOption(cx_OracleUtils.SchemaOption()) parser.AddOption(Options.ARRAY_SIZE) parser.AddOption(Options.REPORT_POINT) parser.AddOption(Options.SET_ROLE) parser.AddOption(Options.DATE_FORMAT) parser.AddOption("--sort-by", metavar="STR", help="append an order by clause with this value to the query") cx_LoggingOptions.AddOptions(parser) parser.AddArgument("fileName", required=True, help="the name of the file to which to write the data or " "'-' to write the data to stdout") parser.AddArgument("source", required = True, help = "the name of the table from which to export all of the data " \ "or the select statement which should be executed to " \