From 474024308ff04373619840b5137e11bf3d0a00c2 Mon Sep 17 00:00:00 2001 From: ferventcoder Date: Fri, 7 Sep 2012 05:10:45 +0000 Subject: [PATCH] https://github.com/chucknorris/roundhouse/pull/59 --- product/roundhouse.databases.oracle/OracleDatabase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/product/roundhouse.databases.oracle/OracleDatabase.cs b/product/roundhouse.databases.oracle/OracleDatabase.cs index f2df4ad..67962fa 100644 --- a/product/roundhouse.databases.oracle/OracleDatabase.cs +++ b/product/roundhouse.databases.oracle/OracleDatabase.cs @@ -132,7 +132,7 @@ public override long insert_version_and_get_version_id(string repository_path, s run_sql(insert_version_script(), ConnectionType.Default, insert_parameters); var select_parameters = new List> { create_parameter("repository_path", DbType.AnsiString, repository_path, 255) }; - return Convert.ToInt64((decimal)run_sql_scalar(get_version_id_script(), ConnectionType.Default, select_parameters)); + return Convert.ToInt64(run_sql_scalar(get_version_id_script(), ConnectionType.Default, select_parameters)); } public override void run_sql(string sql_to_run, ConnectionType connection_type) @@ -172,7 +172,7 @@ private IParameter create_parameter(string name, DbType type, parameter.Direction = ParameterDirection.Input; parameter.ParameterName = name; parameter.DbType = type; - parameter.Value = value; + parameter.Value = value ?? DBNull.Value; if (size != null) { parameter.Size = size.Value; @@ -210,7 +210,7 @@ public string get_version_id_script() SELECT id FROM (SELECT * FROM {0}_{1} WHERE - repository_path = :repository_path + NVL(repository_path, '') = NVL(:repository_path, '') ORDER BY entry_date DESC) WHERE ROWNUM < 2 ",