OracleDbType中的布尔值 [英] Boolean in OracleDbType
本文介绍了OracleDbType中的布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Oracle与Boolean等效吗?我在需要将onlineFiling作为bool传递给存储过程的地方具有此功能,但是显然Oracle在其OracleDbType中没有布尔值.我该怎么做呢?谢谢
what is Oracle equivalent for Boolean? I have this function where I need to pass onlineFiling to a stored procedure as bool but apparently Oracle don't have Boolean in its OracleDbType. How do I do this? thanks
public List<MModel> GetReportData(DateTime startDateTime, DateTime endDateTime, bool onlineFiling)
{
var managementModel = new List<ManagementModel>();
var oracCmd = new OracCommand(1);
oracCmd.AddInParameter(OracleDbType.Date, "I_STARTDATE", startDateTime));
oracCmd.AddInParameter(OracleDbType.Date, "I_ENDDATE", endDateTime));
oracCmd.AddInParameter(OracleDbType.???, "I_ONLINE", onlineFiling));
//rest of code here
推荐答案
Look at the Oracle Data Provider documentation at Data Provider for .NET Developer's Guide. ODP does not seem to support boolean.
一种选择是改为使用Char
或将Number
与1/0一起使用.
One option could be to use Char
instead or Number
with 1/0.
此外,您还应该查看以下SO帖子:
Also you should have a look at following SO posts:
这篇关于OracleDbType中的布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文