如何在hsqldb脚本文件中发表评论

时间:2022-10-18 17:23:54

I want to comment a query in .script file, how do I do this? I tested with #,--,({}),<--! -->,:: nothing worked. I get ad exception about unexpected token.

我想在.script文件中评论一个查询,我该怎么做?我测试了#, - ,({}),< - ! - >,::没什么用的。我得到关于意外令牌的广告例外。

3 个解决方案

#1


3  

I was also having a problem with SQL stye comments in spring embedded database scripts. But it looked like it was because the beginning of each statement to the end of each statement was being processed as a single line thus any -- in the statement caused the rest of that statement, instead of just the rest of the line, to be commented out. So I trying switching to /* ... */ style comments and now life is much betters.

我在Spring嵌入式数据库脚本中遇到了SQL stye注释的问题。但它看起来像是因为每个语句的开头到每个语句的结尾都被处理成一行,因此任何 - 在语句中导致该语句的其余部分,而不仅仅是该行的其余部分,是评论说。所以我尝试切换到/ * ... * /风格评论,现在生活更好。

#2


0  

HSQLDB stores the structure of the database in a file named dbname.script as a set of SQL statements. Normally, this file is not edited by the user. You cannot add comments to this file.

HSQLDB将数据库的结构存储在名为dbname.script的文件中,作为一组SQL语句。通常,用户不会编辑此文件。您无法为此文件添加评论。

You can add comments on tables and columns with the SQL statement below:

您可以使用下面的SQL语句在表和列上添加注释:

COMMENT ON TABLE schemanme.tablename IS 'this is the user comment'

表上的评论schemanme.tablename IS'这是用户评论'

See the Guide:

请参阅指南:

http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N10DDB

http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N10DDB

#3


0  

If you look HERE it says:

如果你看这里它说:

SQL Comments

SQL评论

-- SQL style line comment // Java style line comment /* C style line comment */ All these types of comments are ignored by the database.

- SQL样式行注释// Java样式行注释/ * C样式行注释* /数据库忽略所有这些类型的注释。

But, in practice, at least when running from a spring embedded database script, these seem problematic.

但是,实际上,至少从Spring嵌入式数据库脚本运行时,这些似乎有问题。

#1


3  

I was also having a problem with SQL stye comments in spring embedded database scripts. But it looked like it was because the beginning of each statement to the end of each statement was being processed as a single line thus any -- in the statement caused the rest of that statement, instead of just the rest of the line, to be commented out. So I trying switching to /* ... */ style comments and now life is much betters.

我在Spring嵌入式数据库脚本中遇到了SQL stye注释的问题。但它看起来像是因为每个语句的开头到每个语句的结尾都被处理成一行,因此任何 - 在语句中导致该语句的其余部分,而不仅仅是该行的其余部分,是评论说。所以我尝试切换到/ * ... * /风格评论,现在生活更好。

#2


0  

HSQLDB stores the structure of the database in a file named dbname.script as a set of SQL statements. Normally, this file is not edited by the user. You cannot add comments to this file.

HSQLDB将数据库的结构存储在名为dbname.script的文件中,作为一组SQL语句。通常,用户不会编辑此文件。您无法为此文件添加评论。

You can add comments on tables and columns with the SQL statement below:

您可以使用下面的SQL语句在表和列上添加注释:

COMMENT ON TABLE schemanme.tablename IS 'this is the user comment'

表上的评论schemanme.tablename IS'这是用户评论'

See the Guide:

请参阅指南:

http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N10DDB

http://hsqldb.org/doc/2.0/guide/databaseobjects-chapt.html#N10DDB

#3


0  

If you look HERE it says:

如果你看这里它说:

SQL Comments

SQL评论

-- SQL style line comment // Java style line comment /* C style line comment */ All these types of comments are ignored by the database.

- SQL样式行注释// Java样式行注释/ * C样式行注释* /数据库忽略所有这些类型的注释。

But, in practice, at least when running from a spring embedded database script, these seem problematic.

但是,实际上,至少从Spring嵌入式数据库脚本运行时,这些似乎有问题。