无法在 Firebird 2.5 中声明变量,为什么?
我有一个单行查询:
DECLARE VARIABLE var_SecondsOfTime INTEGER;
但是运行查询后我收到此消息:
引擎错误(代码 = 335544569): 动态 SQL 错误。 SQL错误代码= -104。令牌未知 - 第 1 行第 9 列。变量。
SQL 错误(代码 = -104):无效 令牌。
我在互联网上到处查看,所有示例都显示了我正在使用的相同声明样式。
怎么了?
I have a one line query:
DECLARE VARIABLE var_SecondsOfTime INTEGER;
But after running the query I am getting this message:
Engine Error (code = 335544569):
Dynamic SQL Error. SQL error code =
-104. Token unknown - line 1, column 9. VARIABLE.SQL Error (code = -104): Invalid
token.
I've looked everywhere on the Internet and all examples showing the same declaration style which I am using.
What is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Firebird 2.5 支持执行由 执行块< 包围的代码块/strong> 语句,试试这个:
我发出了选择,因为我很确定不可能执行空块,请自己尝试删除选择。
编辑
我原来的选择对于一个块来说是无效的,我添加了 into 子句来收集结果。我从未使用过 firebird maestro,但它现在在 isql 上完美运行,如图所示。
Firebird 2.5 supports execution of code blocks surrounded by a execute block statement, try this:
I issued the select because I'm pretty sure it is not possible to execute an empty block, try this by yourself removing the select.
Edit
My original select was invalid for a block, I added the into clause to collect the result. I never used firebird maestro, but it now works perfectly on isql, as shown.
试试这个:
第二组术语需要在克拉之前加分号。
Try this:
The second set term needs the semi colon before the carat.