如果选择“字符串” INTO var1 与 WHERE 不返回任何行,字符串是否仍会移至 var1 中?
MOVE "Y" TO :LKG-RETURN
EXEC SQL
SELECT "N"
INTO :LKG-RETURN
FROM SOME_TABLE
WHERE SOME_COLUMN = :SOME_VAR
END-EXEC.
这是 SQLCOBOL 程序的一部分,我需要检查数据库中的某些变量以查看主程序是否必须运行或不是作业。默认情况下,我将“Y”放入返回值中,但如果选择返回行,则不得运行作业,因此我将“N”放入其中。我的问题是:
如果 select 返回 0 行(这意味着作业必须运行),它是否仍然将“N”移动到 :LKG-RETURN?如果是这样,我可以采取哪些选择来达到预期的结果?
谢谢。
MOVE "Y" TO :LKG-RETURN
EXEC SQL
SELECT "N"
INTO :LKG-RETURN
FROM SOME_TABLE
WHERE SOME_COLUMN = :SOME_VAR
END-EXEC.
This is a part of a SQLCOBOL program where I need to check some variable in a database to see if the main program must run or not a job. By default I put "Y" into the return value but if the select return lines the job must not be run, so I put "N" into it. My question is:
If the select return 0 lines (which mean the job must be run), does it still move "N" to :LKG-RETURN? If it does, what could be my options to achieve the desired result?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正常的 SQL 行为是不返回该值。但我从未使用过 SQLCOBOL 来测试这一点。每当我有一丝犹豫时,我都会进行测试。
在缺乏测试能力的情况下,这总是会返回一个值...
或者可能...
但是,认真地说,您需要找到一种方法来测试工作环境中的开发。
我并不羡慕你工作的地方有多困难。我希望这对你有用。
The normal SQL behaviour would be that the value is NOT returned. but I've never used SQLCOBOL to be able to test this. And whenever I have even the remotest hesitation, I test.
In the absence of the ability to test, this will always return a value...
Or possibly...
But, seriously, you need to find a way to test developments in your work environment.
I do not envy how difficult it must be where you work. I hope this works out for you.