如何使用 RetrieVe 或 SQL 查找 UniVerse 中的列列表?

发布于 2024-08-17 14:50:39 字数 413 浏览 3 评论 0原文

我遇到一个问题,其中 table (文件)设置为返回 LIST table 上的列 fooSELECT * FROM表。我需要知道 table 中其他可能的列。我很确定这是通过设置 @ (不合格的 LIST 的行为定义)和 @select (* 的行为定义,非常SELECT),但我不知道如何获取完整的列列表。如何读取 uvsh 中的表架构并查询物理表列?

在表上运行 LIST.ITEM 会显示所有字段编号和值的列表,但如何找到编号字段的 DISPLAY NAME 和列名称?

I've got an issue where a table (file) is set up to return column foo on LIST table and SELECT * FROM table. I need to know the other possible columns in table. I'm pretty sure this was achieved by setting @ (behavoir definition of unqualified LIST), and @select (behavoir definition of * with very SELECT) but I don't know how to get the full list of columns. How do I read the table schema in uvsh and query for the physical table columns?

Running LIST.ITEM on the table shows me a list of all of the field numbers and values, but how do i find the DISPLAY NAME and column name of the numbered fields?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

梦里南柯 2024-08-24 14:50:39

我之前在 SO 上收到的答案提到了 LIST DICT 作为获取一些元数据的方法。这实际上就是我认为我想要的。官方文档使用LIST DICT;但是,在我的系统上,我认为没有 LIST DICT,但确实有。它需要一个文件参数。它也不是一个单独的命令(许多命令中都有空格),而是在(UniVerse 10.1)列表中定义为:

LIST [ DICT | USING [ DICT ] dictname ] filename [ records | FROM n ]
[ selection ] [ output.limiter ] [ sort ] [ output ] [ report.qualifiers ] [TOXML
[ELEMENTS] [WITHDTD] [XMLMAPPING mapping_file]]

所以总而言之,查询数据的相同动词(LIST)是用于查询架构,具有相同的目标文件。

最初,当我认为没有 LIST DICT 时,我使用 RetrieVe 使用 LIST VOC WITH NAME MATCHING LIST... 搜索 VOC 文件,我能够识别出一个类似于 LIST.DICT一个显示按记录类型排序的 DICTIONARIES 内容的 PAragraph。这正是我想要的,只是结果是一个难以管理的 400 行列表。我在任何地方都没有看到 LIST.DICT 的文档,并且似乎记录限定符报告限定符不适用于LIST.DICT 就像他们在 LIST 上所做的那样。这一切都是真的,并且加剧了我的困惑,用 UniVerse 的话说:LIST.DICT 是一个短语,一个存储的语句,LIST 是我需要的动词。

现在回到我的问题:

关于如何使 LIST DICT 的输出易于管理,有什么想法吗?

您可以使用报告限定符,并通过使用位置 F# 语法或通过声明列的名称来显式声明列。

LIST DICT <file> <columns>

在我的系统上,您可以通过发出以下命令来获取字段名称及其显示名称的列表:

LIST DICT <file> NAME

名称来自主字典,可以使用进行查询列表 DICT DICT.DICT

现在,我可以在一个漂亮(相当干净)的列表中看到字段,但我对如何查询文件的所有字段一无所知。

A previous answer I received on SO had mentioned LIST DICT as a way to get some metadata. This was in fact what I think I wanted. The official documentation uses LIST DICT; however, on my system I thought there wasn't LIST DICT, there is. It requires a file argument. It simply wasn't a separate command either (many commands have spaces in them), instead in (UniVerse 10.1) list is defined as:

LIST [ DICT | USING [ DICT ] dictname ] filename [ records | FROM n ]
[ selection ] [ output.limiter ] [ sort ] [ output ] [ report.qualifiers ] [TOXML
[ELEMENTS] [WITHDTD] [XMLMAPPING mapping_file]]

So in summary, The same verb (LIST) to query data is used to query the schema, with the same destination file.

Originally when I presumed there wasn't a LIST DICT I went searching through the VOC file with RetrieVe using LIST VOC WITH NAME MATCHING LIST... I was able to identify a like-named LIST.DICT, a PAragraph that displays the contents of DICTIONARIES sorted by record type. This did exactly what I wanted except the result was a unmanageable list of 400 rows. I don't see the documentation for LIST.DICT anywhere, and it seems as if record qualifiers and report qualifiers don't work on the LIST.DICT like they do on LIST. This was all true and compounded my confusion, in UniVerse parlance: LIST.DICT is a phrase, a stored statement, LIST is the verb I needed.

So now back to my questions:

Any idea on how to make the output of LIST DICT manageable?

You can use the report qualifier and explicitly state columns by using the positional F# syntax, or by stating the names of the columns.

LIST DICT <file> <columns>

on my system you can get a listing of the field names and their display names for instance by issuing

LIST DICT <file> NAME

The NAME comes from the master dictionary, which can be queried using LIST DICT DICT.DICT.

Now, I can see the fields in a nice (fairly clean) list, but I haven't the slightest idea of how to query a file for all of its fields.

清风挽心 2024-08-24 14:50:39

以下是基本变体:

LIST DICT foo NAME

SELECT @ID, NAME FROM DICT foo;

这些将为您提供与 LIST-ITEM 动词相对应的物理位置:

SORT DICT foo WITH TYPE EQ "D" BY LOC LOC NAME

SORT DICT foo WITH TYPE EQ "D" BY LOC LOC NAME TOXML

请注意,在 LIST 或 SORT 过程中默认显示“列名称”或 @ID。 TOXML 可能很有用,但还有许多其他内置的 XML 功能。

Here are the basic varients:

LIST DICT foo NAME

SELECT @ID, NAME FROM DICT foo;

These will give you a physical location that corresponds to the LIST-ITEM verb:

SORT DICT foo WITH TYPE EQ "D" BY LOC LOC NAME

SORT DICT foo WITH TYPE EQ "D" BY LOC LOC NAME TOXML

Note that the "column name" or @ID is displayed by default during a LIST or SORT. TOXML can be useful, but there are a host of other XML features built in.

陈年往事 2024-08-24 14:50:39

在 Universe 中,每个文件都有一个关联的字典文件。字典文件基本上只是一个数据文件,并且可以完全像数据文件一样处理以用于多种目的。字典文件有 3 个特殊之处:

  1. 您可以通过数据文件名前面的“DICT”关键字访问它。
  2. LIST(和相关命令)命令将默认使用它来处理关联的数据文件。
  3. 它具有由 DICT.DICT 文件定义的结构,您需要遵循该结构才能使上面的第 2 项起作用。

一般来说,字典是由程序员和数据库管理员手动维护的。 Universe 中没有任何控件可以保证为关联数据文件中的每个字段创建 DICT 记录,并且没有理由不能为每个字段创建许多 DICT 记录。字典项用于控制输出格式和转换,因此每个数据字段有多个 DICT 项是正常的。

字典记录还可以将数据字段连接在一起,对多个字段执行操作以及从其他文件中获取数据。因此,有时甚至不清楚 DICT 记录实际与哪个数据字段相关。

得出与数据文件相对应的字典项的简单列表的唯一方法是通过检查。使用 LIST DICT {filename} 命令并在其格式字段中查找数据操作量最少的条目。

In Universe every file has an associated dictionary file. The dictionary file is basically just a data file and can be treated exactly like a data file for a variety of purposes. There are 3 things that make a dictionary file special:

  1. You access it via the "DICT" keyword in front of the data file name.
  2. The LIST (and related commands) command will use it by default to process the associated data file.
  3. It has a structure that is defined by the DICT.DICT file, which you need to follow in order for item 2 above to work.

Generally, the dictionaries are maintained by the programmers and database administrators manually. There's no controls in Universe to guarantee that DICT records are created for every field in the associated data file and no reason that you can't have many DICT records for each field. Dictionary items are used to control output formatting and conversions, so it's normal to have multiple DICT items for each data field.

Dictionary records can also join data fields together, perform operations on multiple fields and grab data from other files. So at times it's not even clear what data field a DICT record actually relates to.

The only way to come up with a simple list of dictionary items that correspond to a data file is by inspection. Use the LIST DICT {filename} command and find the entries with the least amount data manipulation in them in their formatting fields.

殤城〤 2024-08-24 14:50:39

一些可能对您有帮助的更有用的语句:

SORT DICT filename
(这与列表相同,只是结果已排序)

仅排序 DICT 文件名
(这仅显示字典名称)

Some more useful statements that could be helpful to you:

SORT DICT filename
(this is the same as list, except the result is sorted)

SORT ONLY DICT filename
(this displays only the dictionary name)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文