(self, src_tbl, dst_tbl, src_curs, dst_curs)
Get common fields, put pkeys in start.
Get common fields, put pkeys in start.
Get common fields put pkeys in start .
def load_common_columns(self, src_tbl, dst_tbl, src_curs, dst_curs):
        """Get common fields, put pkeys in start."""

        self.pkey_list = skytools.get_table_pkeys(src_curs, src_tbl)
        dst_pkey = skytools.get_table_pkeys(dst_curs, dst_tbl)
        if dst_pkey != self.pkey_list:
            self.log.error('pkeys do not match')
            sys.exit(1)

        src_cols = skytools.get_table_columns(src_curs, src_tbl)
        dst_cols = skytools.get_table_columns(dst_curs, dst_tbl)
        field_list = []
        for f in self.pkey_list:
            field_list.append(f)
        for f in src_cols:
            if f in self.pkey_list:
                continue
            if f in dst_cols:
                field_list.append(f)

        self.common_fields = field_list

        fqlist = [skytools.quote_ident(col) for col in field_list]
        self.fq_common_fields = fqlist

        cols = ",".join(fqlist)
        self.log.debug("using columns: %s", cols)
def load_common_columns ( self , src_tbl , dst_tbl , src_curs , dst_curs ) : self . pkey_list = skytools . get_table_pkeys ( src_curs , src_tbl ) dst_pkey = skytools . get_table_pkeys ( dst_curs , dst_tbl ) if dst_pkey != self . pkey_list : self . log . error ( 'pkeys do not match' ) sys . exit ( 1 ) src_cols = skytools . get_table_columns ( src_curs , src_tbl ) dst_cols = skytools . get_table_columns ( dst_curs , dst_tbl ) field_list = [ ] for f in self . pkey_list : field_list . append ( f ) for f in src_cols : if f in self . pkey_list : continue if f in dst_cols : field_list . append ( f ) self . common_fields = field_list fqlist = [ skytools . quote_ident ( col ) for col in field_list ] self . fq_common_fields = fqlist cols = "," . join ( fqlist ) self . log . debug ( "using columns: %s" , cols )