Как получить список таблиц с отключенным Optimistic Concurrency Control
Запись от Kabardian размещена 20.04.2013 в 08:56
источник http://fandyax.blogspot.ru/2012/07/h...-from-aot.html
----------------------------------------------------------------
----------------------------------------------------------------
X++:
static void THK_tableOccenabledFromAOT01(Args _args) { #AOT #properties TreeNode TreeNode = TreeNode::findNode(#TablesPath); str tableName; str temporaryProperty; sysdictTable m_dictTable; int i,records,m; dictionary m_dictionary = new dictionary(); #File #WinAPI #Avifiles CommaIo commaIO; SysOperationProgress sysProgress; fileName fileName; FileIOPermission permission; int start; ; if(!Box::yesNo("Are your sure lookup Occenabled table infomation?",dialogButton::No,"Occenabled Table")) return; fileName = WinAPI::getFolderPath(#CSIDL_Personal) + "\\" + "A02AvgPrice.csv";// + date2str(systemdateget(),321,2,0,2,0,2) + ".CSV"; permission = new FileIOPermission(fileName,#io_write); permission.assert(); commaIo = new CommaIo(fileName,#io_write); if(!commaIo) { warning("Please close your csv file and try again. Thanks!"); return; } if(commaIo.status() == IO_Status::Ok) CommaIo.outFieldDelimiter(","); else return; start = timeNow(); records = m_dictionary.tableCnt(); sysProgress = SysOperationProgress::newGeneral(#AviUpdate,"Waitting ... write CSV file",records); CommaIo.writeExp(["Id","Table Id","Table Name","Table Label","Occenabled","utilElementType"]); for (i = 1; i < records; i++) { m_dictTable = new sysdictTable(m_dictionary.tableCnt2Id(i)); sysProgress.incCount(1); sysProgress.setText(strfmt("completed %1 [%2]: %3",i/ records * 100, i, m_dictTable.name())); if(!m_dictTable.occEnabled()) { m++; CommaIo.writeExp([m,m_dictTable.id(),m_dictTable.name(),m_dictTable.label(),m_dictTable.occEnabled(),m_dictTable.utilElementType()]); } sysProgress.update(true); } if(m) { if (winAPI::fileExists(fileName)) { winAPI::shellExecute(fileName); } } CodeAccessPermission::revertAssert(); info(strfmt("It takes time %1",global::time2StrHMS(timenow() - start))); info(strfmt("completed %1 records",m)); }
Всего комментариев 0