def _UpdateDesc(self):  
        if not self.connection:
            self.close()
            
        force_unicode = self.connection.unicode_results
        if force_unicode:
            Cname = create_buffer_u(1024)
        else:
            Cname = create_buffer(1024)
        
        Cname_ptr = c_short()
        Ctype_code = c_short()
        Csize = ctypes.c_size_t()
        Cdisp_size = c_ssize_t(0)
        CDecimalDigits = c_short()
        Cnull_ok = c_short()
        ColDescr = []
        self._ColTypeCodeList = []
        NOC = self._NumOfCols()
        for col in range(1, NOC+1):
            
            ret = ODBC_API.SQLColAttribute(self.stmt_h, col, SQL_DESC_DISPLAY_SIZE, ADDR(create_buffer(10)), 
                10, ADDR(c_short()),ADDR(Cdisp_size))
            if ret != SQL_SUCCESS:
                check_success(self, ret)
            
            if force_unicode:
            
                ret = ODBC_API.SQLDescribeColW(self.stmt_h, col, Cname, len(Cname), ADDR(Cname_ptr),\
                    ADDR(Ctype_code),ADDR(Csize),ADDR(CDecimalDigits), ADDR(Cnull_ok))
                if ret != SQL_SUCCESS:
                    check_success(self, ret)
            else:
                
                ret = ODBC_API.SQLDescribeCol(self.stmt_h, col, Cname, len(Cname), ADDR(Cname_ptr),\
                    ADDR(Ctype_code),ADDR(Csize),ADDR(CDecimalDigits), ADDR(Cnull_ok))
                if ret != SQL_SUCCESS:
                    check_success(self, ret)
            
            col_name = Cname.value
            if lowercase:
                col_name = col_name.lower()
            #(name, type_code, display_size, 

            ColDescr.append((col_name, SQL_data_type_dict.get(Ctype_code.value,(Ctype_code.value,))[0],Cdisp_size.value,\
                Csize.value, Csize.value,CDecimalDigits.value,Cnull_ok.value == 1 and True or False))
            self._ColTypeCodeList.append(Ctype_code.value)
        
        if len(ColDescr) > 0:
            self.description = ColDescr
            # Create the row type before fetching.
            self._row_type = self.row_type_callable(self)
        else:
            self.description = None
        self._CreateColBuf()
Get the information of (name, type_code, display_size, internal_size, col_precision, scale, null_ok)
dataset/ETHPy150Open harryliu/edwin/edwinServer/site_packages/pypyodbc.py/Cursor._UpdateDesc