| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybPython::dbcmd::MySQLImport Class Reference

Inheritance diagram for DybPython::dbcmd::MySQLImport:
[legend]
Collaboration diagram for DybPython::dbcmd::MySQLImport:
[legend]
List of all members.

Public Member Functions

def __call__
def __init__
def __str__
def __call__

Static Public Attributes

tuple exepath = property( _exepath )
tuple cmd = property( lambda self:self._cmd % self )
tuple cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") )

Static Private Attributes

list _exenames = ['mysqlimport','mysqlimport5']
string _cmd = '%(exepath)s --no-defaults --local --host=%(host)s --user=%(user)s --password=%(password)s --fields-optionally-enclosed-by="\\"" --fields-terminated-by=, --ignore-lines=1 %(database)s %(tabfile)s '

Detailed Description

http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html

`no-defaults` must be the first option
`local` option needed, otherwise mysqlimport: Error: Can't get stat of ...
the table must be pre-existing, otherwise  'tmp_offline_db.SimPmtSpecVld' doesn't exist, when using table: SimPmtSpecVld

a bad import leads to NULLified rows
    0       0000-00-00 00:00:00     0000-00-00 00:00:00     NULL    NULL    NULL    NULL    NULL    0000-00-00 00:00:00     0000-00-00 00:00:00

Definition at line 68 of file dbcmd.py.


Member Function Documentation

def DybPython::dbcmd::MySQLImport::__call__ (   self,
  tabfile,
  verbose = True 
)

Definition at line 72 of file dbcmd.py.

00073                                                 : Error: Can't get stat of ...
00074     the table must be pre-existing, otherwise  'tmp_offline_db.SimPmtSpecVld' doesn't exist, when using table: SimPmtSpecVld
00075 
00076     a bad import leads to NULLified rows

def DybPython::dbcmd::CommandLine::__init__ (   self,
  args,
  kwa 
) [inherited]

Definition at line 17 of file dbcmd.py.

00017                                     :self._cmd % dict(self, password="***") )
00018 
00019     def __init__(self, *args, **kwa ):
00020         dict.__init__(self, *args, **kwa )
00021         exe = self.exepath
00022         assert exe, "cannot find executable %r check your PATH " % self._exenames

def DybPython::dbcmd::CommandLine::__str__ (   self  )  [inherited]

Definition at line 23 of file dbcmd.py.

00025                      :
        return "%s %s " % (self.__class__.__name__, self.cmd_nopw )

def DybPython::dbcmd::CommandLine::__call__ (   self,
  verbose = False 
) [inherited]

Definition at line 26 of file dbcmd.py.

00028                                      :
00029         if verbose:
00030             print self
00031         return os.popen(self.cmd).read()        


Member Data Documentation

list DybPython::dbcmd::MySQLImport::_exenames = ['mysqlimport','mysqlimport5'] [static, private]

Definition at line 70 of file dbcmd.py.

string DybPython::dbcmd::MySQLImport::_cmd = '%(exepath)s --no-defaults --local --host=%(host)s --user=%(user)s --password=%(password)s --fields-optionally-enclosed-by="\\"" --fields-terminated-by=, --ignore-lines=1 %(database)s %(tabfile)s ' [static, private]

Definition at line 71 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::exepath = property( _exepath ) [static, inherited]

Definition at line 13 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::cmd = property( lambda self:self._cmd % self ) [static, inherited]

Definition at line 14 of file dbcmd.py.

tuple DybPython::dbcmd::CommandLine::cmd_nopw = property( lambda self:self._cmd % dict(self, password="***") ) [static, inherited]

Definition at line 15 of file dbcmd.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:13:02 2011 for DybPython by doxygen 1.4.7