Filemaker 重复字段和 ODBC
因此,我正在将旧的 filemaker 数据库传输到 MySQL,一些重复字段给我带来了一些问题。我读到,ODBC 标准仅当它们的类型为“文本”并且每个重复都与特定分隔符连接时才支持这些字段(参见第 47 页 (PDF))。但是,我无法重现这一点。我得到的只是第一次重复。
如果我将数据库导出为 .csv 格式,字段会正确连接,因此我不会完全陷入困境,但如果可能的话,我希望能够通过 ODBC 连接获得相同的结果。谢谢!
So I'm transferring an old filemaker database to MySQL and some repeating fields are causing me some problems. I've read that the ODBC standard support those fields, only when their types is "Text" and that each repetition is concatenated with a certain delimiter (see page 47 (PDF)). However, I just can't reproduce this. All I get is the first repetition.
If I export the database to the .csv format, the fields are correctly concatenated, so I'm not completely stuck, but if possible, I'd like to be able to obtain the same result with the ODBC connection. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 JDBC 和 Filemaker 12,我可以使用括号访问重复字段,因为它是以索引 1 开头的表。
ODBC 中应该是一样的。
当然,我建议标准化,但了解还有其他选择会有所帮助。
With JDBC and Filemaker 12 I can access the repeating field using brackets as it was table beginning with index 1.
It should be the same in ODBC.
Of course I recommend to normalize but it can help to know there is other options.
根据我的经验,有关重复字段的文档是一个谎言。 :)
如果您可以让它工作,请发布答案。但我想你必须使用 csv 导出来解决这个问题。
In my experience the documentation about repeating fields is a lie. :)
If you can get it to work, please, please post an answer. But I imagine you'll have to do the workaround using the csv export.
我对此的建议是将重复字段标准化为 FileMaker 中的单独表,然后执行数据传输。您可以在 FileMaker 中创建相关表,然后使用脚本使用重复字段值填充该表。如果您需要帮助编写此类脚本,请告诉我。
My recommendation regarding this would be to normalize the repeating fields to a separate table within FileMaker and then perform the transfer of the data. You can create a related table in FileMaker and then use a script to populate the table with the repeating field values. Let me know if you need assistance writing such a script.
我想提供有关上面 @Signix 答案的详细信息。我能够从 JDBC 获取重复字段,但这很棘手。 FileMaker“ODBC 和 JDBC 指南”第 30 页指出:
这是唯一的文档!所以理论上你可以使用这个查询:
但棘手的部分是获取结果。唯一的方法似乎是使用列索引。
我认为原因是因为字段的命名没有括号部分。
因此,当使用
resultSet.getString("repField")
时,它会返回具有该名称的第一个列值。这很愚蠢,但很有效。I want to provide details about @Signix answer above. I was able to fetch repeating fields from JDBC but it's tricky. At page 30 of FileMaker "ODBC and JDBC Guide", it states:
This is the only documentation! So in theory you could use this query:
But the tricky part is getting the results. The only way seems to use the column index.
I think the reason is because fields are being named without their bracket parts.
So when using
resultSet.getString("repField")
it returns the first column value with that name. It's stupid but it works.