/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Attributes | Private Member Functions
DybPython::dbselect::Select Class Reference
Collaboration diagram for DybPython::dbselect::Select:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __str__

Static Public Attributes

string tmpl_select = "SELECT * FROM %(tab)s %(where)s %(order_by)s %(into)s "
string tmpl_into = "INTO OUTFILE '%(outfile)s' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'"

Private Member Functions

def _order_by
def _where
def _into

Detailed Description

 Usage::
       select = Select(tab="TableName", write_outfile=False )
       select.db = self

Used to formulate the mysql query string, the result of which 
is used to compose the ascii catalog files

Definition at line 2 of file dbselect.py.


Member Function Documentation

def DybPython::dbselect::Select::__str__ (   self)

Definition at line 15 of file dbselect.py.

00016                      :
00017         return self.tmpl_select % dict( self, order_by=self._order_by(), into=self._into(), where=self._where() )

def DybPython::dbselect::Select::_order_by (   self) [private]

Definition at line 18 of file dbselect.py.

00019                        :
00020        tn = self['tab']
00021        if tn in ("LOCALSEQNO","GLOBALSEQNO",):
00022            return " order by TABLENAME "
00023        elif tn[-3:] == "Vld":
00024            return " order by SEQNO "
00025        else:
00026            return " order by SEQNO,ROW_COUNTER "

def DybPython::dbselect::Select::_where (   self) [private]
NB for LOCALSEQNO tables in decoupled mode (the default) a where clause
is used to restrict the tables written to those that `self.db.paytables` returns.
These are the selected tables, which need to be manually added to tselect on adding tables.
This is probably the cause of #1269 (failure to fully handle a new McsPos table)
in concert with using an older `db.py` with a tselect excluding `McsPos`

Definition at line 27 of file dbselect.py.

00028                     :
00029         """
00030         NB for LOCALSEQNO tables in decoupled mode (the default) a where clause
00031         is used to restrict the tables written to those that `self.db.paytables` returns.
00032         These are the selected tables, which need to be manually added to tselect on adding tables.
00033         This is probably the cause of #1269 (failure to fully handle a new McsPos table)
00034         in concert with using an older `db.py` with a tselect excluding `McsPos`
00035         """
00036         tn = self['tab']
00037         tabtuple = str(tuple(['*'] + self.db.paytables))
00038         if self.db.opts['decoupled'] and tn in ('LOCALSEQNO','GLOBALSEQNO',):
00039             return "WHERE TABLENAME IN %(tabtuple)s " % locals()
00040         else:   
00041             return "" 

def DybPython::dbselect::Select::_into (   self) [private]

Definition at line 42 of file dbselect.py.

00043                    :
00044         if self.get('outfile',None):
00045              return self.tmpl_into % self
00046         else:
00047              return ""
00048 


Member Data Documentation

string DybPython::dbselect::Select::tmpl_select = "SELECT * FROM %(tab)s %(where)s %(order_by)s %(into)s " [static]

Definition at line 12 of file dbselect.py.

string DybPython::dbselect::Select::tmpl_into = "INTO OUTFILE '%(outfile)s' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'" [static]

Definition at line 13 of file dbselect.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 Fri May 16 2014 09:55:40 for DybPython by doxygen 1.7.4