前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >IRIS / Chronicles 数据结构备忘录

IRIS / Chronicles 数据结构备忘录

原创
作者头像
HoneyMoose
发布2024-04-08 04:01:13
580
发布2024-04-08 04:01:13
举报
文章被收录于专栏:CWIKIUSCWIKIUS

数据结构的内容主要涉及到索引和全局变量。

这部分的内容的问题在于概念多,和普通的数据库对应的内容也不太一样,需要花点时间了解。

networked items

有关英文的解释是:

Networked items that point to databases that use padded-string IDs always store the external (unpadded) form of the target record’s .1 item. This eliminates the padding factor dependency, which could be changed through a data conversion. If the database networked to uses numeric IDs, then the value stored in the item is identical to the record’s ID.

说人话就是对于一个 Item 是 networked 的话,这个 Item 中存储的数据就是根据 .1 这个 Item external (unpadded) 来的。

这里有 2 个概念,.1 这个 Item 可以存字符串,.1 这个Item 也可以存全是数字,当如果 .1 存储是全是数字的话,networked 的存储数据和 .1 中的数据是相同的。 但是,因为 padded 的问题,针对 String 的 Padded 的时候,会在字符串前面加空格,这会导致在数据转换的时候可能会不一致。 这个知识点就想表达的意思就是可能数据在转换的时候会不一致。

Chronicles Locators

Chronicles Locators describe the subscripts used to define nodes in Chronicles Data Globals. The 5 standard locators are INI, ID, DAT, Item # and Line #. In addition to being subscripts to globals, the locators are also used as input to various routines and utilities, as well as arguments to Chronicles API.

Chronicles Locators 主要用途就是把数据从 Chronicles Data Globals 读取出来。要读取 Chronicles Data Globals 中的数据,需要有 5 个参数:INI, ID, DAT, Item # 和 Line #。

用中文来翻译的话,这个应该叫做 Chronicles 数据全局。

Chronicles Data Globals 可以认为是 Chronicles 和 M 语言全局变量中的一个映射。

根据我们对 Chronicles 数据库的了解,Chronicles 将会把数据映射到 M 语言的全局变量中,然后提供语言级别的调用,这个和我们常用的关系数据库不一样,因为我们不可能把数据库中的内容全部映射到一个程序语言的全局变量中,这会导致溢出的。

但 Chronicles 这个数据就是这样操作的。

Remember to look before you leap; view your test data before writing code to load it, so you know what to expect. To create your test data, use Chronicles. To see the raw data and locators along with most translations, use the Record Viewer. The important locators can be seen in the chart below and will be critical to loading in the next section.

Determine the number of lines of data in an item

Multiple, related and related-multiple response items maintain a line count within line 0 of the item. This line 0 line count is not necessary for a single response item because single response items (by definition) may not have more than one line.

Multiple, related 和 related-multiple 这 3 个 Response Type 中的数字分别有不同的意思。

Multiple, related 的 Line 0 表示的是一共有多少个 Line。

related-multiple 的 Line 0 表示的内容也是 Count 这个 Line 的数量,但是后面用一个 2 维数组来表示了。比如说,1,0 的值如果是 1 的话,表示这个 RM 只有一个 Line。

那对应的下一个 Line # 就是 1,1。

如果 1,0 的值为 2 的话,就表示这个 RM 会有 2 个 Line。

那么对应的好后续值分别为 1,1 和 1,2。

哪怕就是采用上面的表示方式,related-multiple 还是有一个 Line 为 0 的东西,这个表示的是这个 related-multiple 下面一共有多少条记录。

总结来说,当 Line # 为 0 的时候表示的就是数量。

Explain what is used to identify contacts in Chronicles Data Globals that store information over time

Contacts are identified by DAT. The DAT is derived from the internal format of the date subtracted from a constant (121531) to ensure that when using a natural sort order the most recent information is returned first.

在 Chronicles Data Globals 中,就是在 M 语言的全局变量中,Contacts 数据是通过 DAT 来进行定义的。

这里就有一个计算方法了,DAT=121531-DTE。

所以随着时间的推移,DAT 在系统中的数值是越来越小的,等于在系统中是递减的,然后在显示的时候排序就是小的在前面,这样能够保证最新的数据在最前面,按照 DAT 从小到大的方式来显示。

上图显示了 DAT 的排序情况。

https://www.isharkfly.com/t/iris-chronicles/15621

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • networked items
  • Chronicles Locators
  • Determine the number of lines of data in an item
  • Explain what is used to identify contacts in Chronicles Data Globals that store information over time
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档