简体   繁体   English

Show tables 语句导致 Token unknown 错误

[英]Show tables statement results in Token unknown error

I am having to integrate with a Firebird 1.5 database.我必须与 Firebird 1.5 数据库集成。 We can't upgrade the DB to a newer version.我们无法将数据库升级到较新的版本。

I run the below code to attempt to see what the tables are我运行下面的代码来尝试查看表格是什么

var Firebird = require('node-firebird');

var options = {};

options.host = '127.0.0.1';
options.port = 3050;
options.database = 'C:\\Database.fdb';
options.user = 'sysdba';
options.password = 'masterkey';
options.lowercase_keys = false; // set to true to lowercase keys
options.role = null;            // default
options.pageSize = 4096;        // default when creating database
options.pageSize = 4096;        // default when creating database
options.retryConnectionInterval = 1000; // reconnect interval in case of connection drop

Firebird.attach(options, function(err, db) {
    console.log("starting");
    if (err) {
        console.log(err)
        throw err;
    }
    
    // db = DATABASE
    db.execute('show tables', function(err, result) {
        // IMPORTANT: close the connection
        console.log(err)
        console.log(result)
        db.detach();
    });

});

The above results in the following error:以上导致以下错误:

Error: Dynamic SQL Error, SQL error code = -104, Token unknown - line 1, column 1, show
    at doCallback (C:\nodetest\node_modules\node-firebird\lib\index.js:1321:21)
    at C:\nodetest\node_modules\node-firebird\lib\index.js:3100:25
    at C:\nodetest\node_modules\node-firebird\lib\messages.js:151:25
    at search (C:\nodetest\node_modules\node-firebird\lib\messages.js:117:13)
    at C:\nodetest\node_modules\node-firebird\lib\messages.js:54:21
    at FSReqCallback.wrapper [as oncomplete] (node:fs:675:5) {
  gdscode: 335544569,
  gdsparams: undefined
}

Changing just the query in the code to a select on a table I know should exist仅将代码中的查询更改为我知道应该存在的表上的 select

select first 1 * from tag

Just sits hanging as if the code is stuck trying to read the table.就像代码被卡在试图读取表格一样挂着。

Is there anything obvious I'm doing wrong?有什么明显的我做错了吗? Or is there a different way we should be connecting to this database?或者我们应该以不同的方式连接到这个数据库?

Firebird doesn't have a show tables statement. Firebird 没有show tables语句。 That is a command specific to the Firebird isql query tool.这是特定于 Firebird isql查询工具的命令。 To query for tables, you need to query the metadata tables, eg要查询表,您需要查询元数据表,例如

select RDB$RELATION_NAME from RDB$RELATIONS

(note: this will also includes views, to exclude them add condition where RDB$VIEW_BLR is null ) (注意:这也将包括视图,以排除它们添加where RDB$VIEW_BLR is null

As an aside, Firebird 1.5 has been end-of-life since October 2009. Several security issues have been solved in newer versions.顺便说一句,Firebird 1.5 已于 2009 年 10 月终止使用。在较新的版本中已解决了几个安全问题。 You should really upgrade to a newer version.你真的应该升级到更新的版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 FCM错误结果 - 将错误引用到令牌 - FCM error results - refer error to token 未知错误:SyntaxError:ng 命令上出现意外的令牌“导出” - Unknown error: SyntaxError: Unexpected token 'export' on ng command 序列化多表OR语句未知列错误 - Sequelize multi-table OR statement unknown column error 如何解决 d3-array/src/number.js 的语法错误:“ForOfStatement”类型的未知语句 - How to solve syntax error of d3-array/src/number.js: unknown Statement of type "ForOfStatement" nodejs分析未知和未记录的结果 - nodejs profiling unknown and unaccounted results npm install "npm ERR. Unexpected token ','" on using NVM-Windows, Node v17, NPM v8 出现未知错误 - unknown error on npm install "npm ERR! Unexpected token '.'" on using NVM-Windows, Node v17, NPM v8 语法错误:无法在模块外部使用 import 语句/意外标记“&lt;” - 相关错误 - Syntax Error: Cannot use import statement outside a module / Unexpected token '<' - related errors 发布获取缩放 oauth2.0 令牌的请求导致 403 错误 - Post request to get zoom oauth2.0 token results in 403 error Babel 打字稿意外标记“?” 在声明中 - Babel typescript unexpected token '?' in statement 部署 Firebase 和 Node.js 应用程序导致错误:Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1 - Deploying Firebase and Node.js application results in error: Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM