zoukankan      html  css  js  c++  java
  • 查找某个表的特定RECID行的主索引字段值

    static void FindPrimaryIdx(Args _args)

    {

         DictTable       dt;

         DictIndex       di;

         Common          cm;

         IndexID         idx;

         int             i, iCnt;

         FieldID         fid;

         FieldID         fids[,10];

         int             fidsCnt = 0;

         str             s;

         str             sTemp;

         int _tID=175,_rID=956968;//可以修改或使用参数传递

     

         ;

         dt  = new DictTable(_tid);

         if (dt) {

             idx = dt.primaryIndex();

             if (idx) {

                 di  = dt.indexObject(idx);

                 if (di) {

                     iCnt = di.numberOfFields();

                     for (i=1;i<=iCnt;i++) {

                         fid = di.field(i);

                         if (fid) {

                             fidsCnt++;

                             fids[fidsCnt] = fid;

                         }

                     }

                 }

             }

             cm = dt.makeRecord();

             select firstonly * from cm

             where cm.RecId == _rid;

             if (cm.RecId) {

                 // 找不到记录

                 for (i=1;i<=fidscnt;i++) {

                     fid   = fids[i];

                     sTemp = strfmt('[%1]=[%2]',fieldId2Name(_tid, fid),cm.(fid));

                     if (s) s = s+',';

                     s        = s + sTemp;

                     info(s);

                 }

             }

         }

     

    }

  • 相关阅读:
    数据结构之双向链表
    数据结构入门之链表(C语言实现)
    机器人操作臂运动学入门一--D-H参数标定
    机器学习--逻辑回归
    python字符串方法的简单使用
    python学习之网页数据获取
    《机器学习实战》学习笔记一K邻近算法
    杂事
    洛谷 P1926 小书童——刷题大军
    洛谷 P1968 美元汇率
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2761591.html
Copyright © 2011-2022 走看看