我正在使用 firebird Embedded v 2.5 和 .net FirebirdSql.Data.FirebirdClient。我需要能够检索给定数据库的ODS版本。
我试过了:
private string GetOds(FbConnection connection)
{
using (var cmd = new FbCommand())
{
var sqlQuery = "select rdb$get_context('SYSTEM','ENGINE_VERSION') as version from RDB$DATABASE";
cmd.CommandText = sqlQuery;
cmd.Connection = connection;
cmd.CommandType = CommandType.Text;
using (var reader = cmd.ExecuteReader()) // HERE ITS WHERE THE EXCEPTION IS GENERATED.
{
...
}
}
}
这会生成一个执行:{"Dynamic SQL Error\r\nSQL error code = -804\r\nFunction unknown\r\nRDB$GET_CONTEXT"}