Skip to content

Commit

Permalink
edit data: handle oracle sdo_geometry.
Browse files Browse the repository at this point in the history
  • Loading branch information
victor committed Sep 11, 2024
1 parent 039191b commit ea07ade
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions DatabaseManager/DatabaseManager.CoreApp/Controls/UC_DataEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,9 +1103,15 @@ private List<ExecuteScriptInfo> GetUpdateScripts(DbScriptGenerator scriptGenerat

if (this.displayInfo.DatabaseType == DatabaseType.Oracle)
{
parsedValue = parsedValue?.ToString()?.Replace($",{OracleInterpreter.DEFAULT_GEOMETRY_SRID})",
$",{this.GetTableNameAlias()}.{quotedColumnName}.{this.GetOracleSridCall(tc.DataType)})");
}
if (parsedValue != null)
{
string strParsedValue = parsedValue.ToString();
int index = strParsedValue.LastIndexOf(',');

parsedValue = strParsedValue.Substring(0, index)
+ $",{this.GetTableNameAlias()}.{quotedColumnName}.{this.GetOracleSridCall(tc.DataType)})";
}
}

sets.Add($"{quotedColumnName}={parsedValue}");
}
Expand Down Expand Up @@ -1256,7 +1262,7 @@ private string GetConditionItem(string columnName, object value, object parsedVa

private string GetOracleSridCall(string dataType)
{
if(dataType.ToLower().EndsWith("st_geometry"))
if (dataType.ToLower().EndsWith("st_geometry"))
{
return "ST_SRID()";
}
Expand Down Expand Up @@ -1312,7 +1318,7 @@ private void UC_DataEditor_MouseMove(object sender, MouseEventArgs e)
this.dgvData.EndEdit();
}
}
}
}
}
}

0 comments on commit ea07ade

Please sign in to comment.