gpt4 book ai didi

oracle-sqldeveloper - 零长度单行注释导致解析错误

转载 作者:行者123 更新时间:2023-12-02 04:24:52 24 4
gpt4 key购买 nike

不是最重要的,但如果有人可以解释我在 11g 和 12c,Oracle SQL Developer 17.3.1.279 上获得的零长度单行注释的这种行为,我会很感兴趣。我特别发现测试 3 (--a) 和测试 5 (---) 的不同结果很有趣:

-- Test 1
select * from dual;
-- works

-- Test 2
select * from -- comment
dual;
/* works, 'Query Result SQL' shows (note this is 2 lines)
select * from -- comment
dual
*/

-- Test 3
select * from --a
dual;
/* works, 'Query Result SQL' shows (note this is 2 lines)
select * from --a
dual
*/

-- Test 4
select * from --
dual;
/* does not work, ORA-00903: invalid table name, 'Query Result SQL' shows (note this is 1 line)
select * from - dual
*/

-- Test 5
select * from ---
dual;
/* does not work, ORA-00903: invalid table name, 'Query Result SQL' shows (note this is 1 line)
select * from -- dual
*/

根据我能找到的 10g 文档,----- 都应该有效 https://docs.oracle.com/cd/B13789_01/server.101/b10759/sql_elements006.htm :

Begin the comment with -- (two hyphens). Proceed with the text of the comment. This text cannot extend to a new line. End the comment with a line break.

最佳答案

查看评论。这是 oracle sql developer 中的错误。

关于oracle-sqldeveloper - 零长度单行注释导致解析错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55569352/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com