人大金仓 调用存储过程数据库字段类型返回问题 返回
SqlSugar
沟通中
1
177
tcc 发布于1个月前
悬赏:20 飞吻
使用人大金仓数据库时,调用原生sql和调用存储过程的返回结果的数据类型不一致。
代码如下
Sql脚本:
CREATE TABLE t_test ( "bit" bit(1) NULL, "number" number(1,0) NULL, "boolean" boolean NULL ); INSERT INTO "t_test" ("bit", "number", "boolean") VALUES('1', 1, true); INSERT INTO "t_test" ("bit", "number", "boolean") VALUES('0', 0, false); INSERT INTO "t_test" ("bit", "number", "boolean") VALUES(NULL, NULL, NULL); CREATE OR REPLACE PROCEDURE proc_test() AS BEGIN SELECT * FROM t_test; END ;
SqlSugar 5.1.4.166
人大金仓 KingbaseES V008R006C008B0020 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
database_mode:oracle
public object GetDataDemo() { SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.Kdbndp, ConnectionString = "Server=192.168.1.1;Port=54322;UID=system;PWD=123456;database=test;searchpath=test", IsAutoCloseConnection = true, AopEvents = new AopEvents { OnLogExecuting = (sql, p) => { Console.WriteLine(sql); Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value))); } }, MoreSettings = new ConnMoreSettings() { DatabaseModel = DbType.Oracle, IsAutoToUpper = true, } }); try { var retData = db.Ado.GetDataTable("select * from t_test"); var retData2 = db.Ado.UseStoredProcedure().GetDataTable("proc_test"); return true; } catch (Exception ex) { return ex.Message.ToString(); } }
热忱回答(1)
-
fate sta VIP01个月前
这个在找金仓官方沟通了
0 回复