如何在不实际阅读rpgle中的记录的情况下删除记录
最近,我遇到了一个在RPGLE采访中问我的问题。我被问及如何在不实际阅读rpgle上删除唱片。我的答案是我们可以使用嵌入式SQL,但他在SQL中告诉我们仍在阅读数据。 因此,在这个社区中,如果有人知道“如何在rpgle中删除唱片而不实际阅读记录”,请让我知道,我很高兴知道答案。
提前致谢
Recently I came across a question that was asked to me in a RPGLE interview. I was asked how to delete a record without actually reading it in RPGLE. My answer was we can use embedded SQL , but he told in SQL we are still reading the data.
So in this community if anyone knows "how to delete a record without actually reading it in RPGLE" please let me know, I would be delighted to know the answer.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因子-1搜索参数
您只需提供自由形式的
,就在手动

我必须承认,我不得不看一下,从头到头,我想:“你不能”。现在,我的记忆已经刷新了,我想我记得在我使用RPG的30年中一次或两次这样做。
请注意,RPGIII有相同的支持。
您的“使用SQL”的答案在我的书中是正确的。假设您谈论的是“搜索”删除,
而不是“定位”删除,
最终您的访调员认为,如果他认为RPG搜索的RPG搜索删除删除不会首先读取记录,而是SQL One确实读取了记录。请注意,引用 的突出显示了 用于检索要删除的记录的部分。
数据库记录必须为阅读以删除。唯一的问题是您通过阅读/链或SQL光标明确阅读它。还是DB通过“搜索”删除为您做的。
You simply provide a factor-1 search argument
In free form,
It's in the manual

I must admit, I had to look it up, off the top of my head I thought, "you can't". Now that my memory is refreshed, I think I recall doing this once or twice in the 30yrs I've been using RPG.
Note that RPGIII had the same support.
Your answer of "use SQL" would have been correct in my book. Assuming you're talking about the "search" delete
rather than a "positioned" delete
Finally your interviewer is misinformed if he thinks the RPG Searched delete doesn't read the record first but that the SQL one does. Note the highlighted section of the quote used to retrieve the record to be deleted.
A database record has to be read in order to be deleted. The only question is are you reading it explicitly, via READ/CHAIN or an SQL Cursor. Or is the DB doing it for you via "search" delete.