0

用文本写的列有一个条件:

SomeDecimalColumn = 1234567890 <use your favorite decimal here>

我需要对 Firebird 数据库进行查询以包含此条件。我自然尝试过:

//query is a QueryObject of firebird database connection (FbConnection).
// SELECT "A"."SomeDecimalColumn" as C1 
// FROM "MYTABLE" AS "A"
// # SomeDecimalColumn has type DECIMAL(18,0)
var predicate = "SomeDecimalColumn = 1234567890"
query = query.Where(predicate);
//query:
// SELECT "A"."SomeDecimalColumn" as C1 
// FROM "MYTABLE" AS "A" 
// WHERE CAST(1234567890 AS DECIMAL(9,0)) = "A"."SomeDecimalColumn"

它让我感到困扰,它默认将字符串转换为DECIMAL(9,0)。有没有办法强制铸造到一定的精度,即力DECIMAL(18,0)

我无法解析此字符串以将 ColumnName 与 Value 分开。我不知道我会得到什么样的谓词。

4

0 回答 0