如何从进度数据库获取 ROWID
我有一个 Progress 数据库,我正在其中执行 ETL。 我正在读取的表之一没有唯一键,因此我需要访问 ROWID 才能唯一标识该行。 访问正在进行的 ROWID 的语法是什么?
我知道使用 ROWID 进行行标识存在问题,但这就是我现在所拥有的。
I have a Progress database that I'm performing an ETL from. One of the tables that I'm reading from does not have a unique key on it, so I need to access the ROWID to be able to uniquely identify the row. What is the syntax for accessing the ROWID in Progress?
I understand there are problems with using ROWID for row identification, but it's all I have right now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对我的回答有一个简短的警告 - 自从我与 Progress 合作以来已经近 10 年了,所以我的知识可能不仅仅是一个有点过时了。
检查Progress 语言参考 [PDF ] 似乎显示我记得的两个函数仍然存在:
ROWID
和RECID
。ROWID
函数较新,是首选函数。在 Progress 4GL 中,您可以像这样使用它:
或者:
检查 Progress SQL 参考 [PDF] 显示
ROWID
在 SQL 中也可作为 Progress 扩展使用。 您可以像这样使用它:编辑:根据 Stefan 的反馈进行编辑。
A quick caveat for my answer - it's nearly 10 years since I worked with Progress so my knowledge is probably more than a little out of date.
Checking the Progress Language Reference [PDF] seems to show the two functions I remember are still there:
ROWID
andRECID
. TheROWID
function is newer and is preferred.In Progress 4GL you'd use it something like this:
or:
Checking the Progress SQL Reference [PDF] shows
ROWID
is also available in SQL as a Progress extension. You'd use it like so:Edit: Edited following Stefan's feedback.
根据您的情况和应用程序的行为,这可能重要也可能无关紧要,但您应该知道 ROWID 和 ROWID 是唯一的。 RECID 可以重复使用,并且可能会发生变化。
1)如果一条记录被删除,它的ROWID最终将被重用。
2)如果通过转储和重组表; 加载或表移动到新的存储区域,那么 ROWID 将发生变化。
Depending on your situation and the behavior of the application this may or may not matter but you should be aware that ROWIDs & RECIDs are reused and that they may change.
1) If a record is deleted it's ROWID will eventually be reused.
2) If the table is reorganized via a dump & load or a tablemove to a new storage area then the ROWIDs will change.
只是为戴夫·韦伯的答案添加一点内容。 我在 select 语句中尝试了 ROWID,但出现语法错误。 ROWID 仅在指定要选择的其余列时才起作用,不能使用 *。
这不起作用:
这确实起作用:
Just to add a little to Dave Webb's answers. I had tried ROWID in the select statement but was given a syntax error. ROWID only works if you specify the rest of the columns to select, you cannot use *.
This does NOT work:
This does work:
谷歌快速搜索发现了这个:
http://bytes.com/forum/thread174440.html
阅读底部的消息[email protected](您需要 oid 或 ctid,具体取决于您的保证想要重新持久性和独特性)
A quick google search turns up this:
http://bytes.com/forum/thread174440.html
Read the message towards the bottom by [email protected] (you either want oid or ctid depending on what guarantees you want re persistence and uniqueness)